Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

UserManager does not normalize role name before passing to UserStore #716

@kidtsui

Description

@kidtsui

When I read the code for FindByNameAsync, the UserManager will first normalize the user name then pass to UserStore to find the user by the normalized user name.

However, when adding roles to a user, the UserManager only pass the rolename without any normalizations. This pattern is not consistent with the previous case.

And the related issue is that the UserStore in entityframework search for the roles by only using just a upper case comparison.
var roleEntity = await Roles.SingleOrDefaultAsync(r => r.Name.ToUpper() == roleName.ToUpper(), cancellationToken);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions