UserManager<TUser> Class

Exposes user related api which will automatically save changes to the UserStore

Inheritance Hierarchy

System.Object
  Microsoft.AspNet.Identity.UserManager<TUser>

Namespace:  Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

'Declaration
Public Class UserManager(Of TUser As IUser) _
    Implements IDisposable
'Usage
Dim instance As UserManager(Of TUser)
public class UserManager<TUser> : IDisposable 
where TUser : IUser
generic<typename TUser>
where TUser : IUser 
public ref class UserManager : IDisposable
type UserManager<'TUser when 'TUser : IUser> =  
    class 
        interface IDisposable 
    end
JScript does not support generic types and methods.

Type Parameters

  • TUser

The UserManager<TUser> type exposes the following members.

Constructors

  Name Description
Public method UserManager<TUser> Constructor

Top

Properties

  Name Description
Public property ClaimsIdentityFactory Used to create claims identities from users
Public property PasswordHasher Used to hash/verify passwords
Public property PasswordValidator Used to validate passwords before persisting changes
Protected property Store Persistence abstraction that the Manager operates against
Public property SupportsUserClaim Returns true if the store is an IUserClaimStore
Public property SupportsUserLogin Returns true if the store is an IUserLoginStore
Public property SupportsUserPassword Returns true if the store is an IUserPasswordStore
Public property SupportsUserRole Returns true if the store is an IUserRoleStore
Public property SupportsUserSecurityStamp Returns true if the store is an IUserSecurityStore
Public property UserValidator Used to validate users before persisting changes

Top

Methods

  Name Description
Public method AddClaimAsync Add a user claim
Public method AddLoginAsync Associate a login with a user
Public method AddPasswordAsync Add a user password only if one does not already exist
Public method AddToRoleAsync Add a user to a role
Public method ChangePasswordAsync Change a user password
Public method CreateAsync(TUser) Create a user with no password
Public method CreateAsync(TUser, String) Create a user and associates it with the given password (if one is provided)
Public method CreateIdentityAsync Creates a ClaimsIdentity representing the user
Public method Dispose() Dispose the store context
Protected method Dispose(Boolean) When disposing, actually dipose the store context
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method FindAsync(UserLoginInfo) Returns the user associated with this login
Public method FindAsync(String, String) Return a user with the specified username and password or null if there is no match.
Public method FindByIdAsync Find a user by id
Public method FindByNameAsync Find a user by name
Public method GetClaimsAsync Get a users's claims
Public method GetHashCode (Inherited from Object.)
Public method GetLoginsAsync Gets the logins for a user.
Public method GetRolesAsync Returns the roles for the user
Public method GetType (Inherited from Object.)
Public method HasPasswordAsync Returns true if the user has a password
Public method IsInRoleAsync Returns true if the user is in the specified role
Protected method MemberwiseClone (Inherited from Object.)
Public method RemoveClaimAsync Remove a user claim
Public method RemoveFromRoleAsync Remove a user from a role.
Public method RemoveLoginAsync Remove a user login
Public method RemovePasswordAsync Remove a user's password
Public method ToString (Inherited from Object.)
Public method UpdateAsync Update a user
Public method UpdateSecurityStampAsync Generate a new security stamp for a user, used for SignOutEverywhere functionality

Top

Extension Methods

  Name Description
Public Extension Method AddClaim<TUser> Add a user claim (Defined by UserManagerExtensions.)
Public Extension Method AddLogin<TUser> Sync extension (Defined by UserManagerExtensions.)
Public Extension Method AddPassword<TUser> Add a user password only if one does not already exist (Defined by UserManagerExtensions.)
Public Extension Method AddToRole<TUser> Add a user to a role (Defined by UserManagerExtensions.)
Public Extension Method ChangePassword<TUser> Change a user password (Defined by UserManagerExtensions.)
Public Extension Method Create<TUser>(TUser) Overloaded. Create a user with no password (Defined by UserManagerExtensions.)
Public Extension Method Create<TUser>(TUser, String) Overloaded. Create a user and associates it with the given password (if one is provided) (Defined by UserManagerExtensions.)
Public Extension Method CreateIdentity<TUser> Creates a ClaimsIdentity representing the user (Defined by UserManagerExtensions.)
Public Extension Method Find<TUser>(UserLoginInfo) Overloaded. Sync extension (Defined by UserManagerExtensions.)
Public Extension Method Find<TUser>(String, String) Overloaded. Return a user with the specified username and password or null if there is no match. (Defined by UserManagerExtensions.)
Public Extension Method FindById<TUser> Find a user by id (Defined by UserManagerExtensions.)
Public Extension Method FindByName<TUser> Find a user by name (Defined by UserManagerExtensions.)
Public Extension Method GetClaims<TUser> Get a users's claims (Defined by UserManagerExtensions.)
Public Extension Method GetLogins<TUser> Gets the logins for a user. (Defined by UserManagerExtensions.)
Public Extension Method GetRoles<TUser> Get a users's roles (Defined by UserManagerExtensions.)
Public Extension Method HasPassword<TUser> Returns true if a user has a password set (Defined by UserManagerExtensions.)
Public Extension Method IsInRole<TUser> Returns true if the user is in the specified role (Defined by UserManagerExtensions.)
Public Extension Method RemoveClaim<TUser> Remove a user claim (Defined by UserManagerExtensions.)
Public Extension Method RemoveFromRole<TUser> Remove a user from a role. (Defined by UserManagerExtensions.)
Public Extension Method RemoveLogin<TUser> Remove a user login (Defined by UserManagerExtensions.)
Public Extension Method RemovePassword<TUser> Associate a login with a user (Defined by UserManagerExtensions.)
Public Extension Method Update<TUser> Update an user (Defined by UserManagerExtensions.)
Public Extension Method UpdateSecurityStamp<TUser> Generate a new security stamp for a user, used for SignOutEverywhere functionality (Defined by UserManagerExtensions.)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.AspNet.Identity Namespace