View Source
Class UmbracoUserStore<TUser, TRole>
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public abstract class UmbracoUserStore<TUser, TRole> : UserStoreBase<TUser, TRole, string, IdentityUserClaim<string>, IdentityUserRole<string>, IdentityUserLogin<string>, IdentityUserToken<string>, IdentityRoleClaim<string>> where TUser : UmbracoIdentityUser where TRole : IdentityRole<string>
Type Parameters
Name |
Description |
TUser |
|
TRole |
|
Constructors
View Source
UmbracoUserStore(IdentityErrorDescriber)
Declaration
protected UmbracoUserStore(IdentityErrorDescriber describer)
Parameters
Type |
Name |
Description |
IdentityErrorDescriber |
describer |
|
Properties
View Source
Users
Declaration
public override IQueryable<TUser> Users { get; }
Property Value
Type |
Description |
IQueryable<TUser> |
|
Methods
View Source
AddClaimsAsync(TUser, IEnumerable<Claim>, CancellationToken)
Declaration
public override Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
IEnumerable<System.Security.Claims.Claim> |
claims |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
AddToRoleAsync(TUser, String, CancellationToken)
Adds a user to a role (user group)
Declaration
public override Task AddToRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
normalizedRoleName |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
AddUserTokenAsync(IdentityUserToken<String>)
Not supported in Umbraco, see comments above on GetTokenAsync, RemoveTokenAsync, SetTokenAsync
Declaration
protected override Task AddUserTokenAsync(IdentityUserToken<string> token)
Parameters
Type |
Name |
Description |
Umbraco.Cms.Core.Security.IdentityUserToken<System.String> |
token |
|
Returns
View Source
FindByIdAsync(String, CancellationToken)
Declaration
public override Task<TUser> FindByIdAsync(string userId, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
System.String |
userId |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<TUser> |
|
View Source
FindTokenAsync(TUser, String, String, CancellationToken)
Not supported in Umbraco, see comments above on GetTokenAsync, RemoveTokenAsync, SetTokenAsync
Declaration
protected override Task<IdentityUserToken<string>> FindTokenAsync(TUser user, string loginProvider, string name, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
loginProvider |
|
System.String |
name |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<Umbraco.Cms.Core.Security.IdentityUserToken<System.String>> |
|
View Source
GetClaimsAsync(TUser, CancellationToken)
Declaration
public override Task<IList<Claim>> GetClaimsAsync(TUser user, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<IList<System.Security.Claims.Claim>> |
|
View Source
GetNormalizedEmailAsync(TUser, CancellationToken)
Declaration
public override Task<string> GetNormalizedEmailAsync(TUser user, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
TUser |
user |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.String> |
|
View Source
GetNormalizedUserNameAsync(TUser, CancellationToken)
Declaration
public override Task<string> GetNormalizedUserNameAsync(TUser user, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.String> |
|
View Source
GetRolesAsync(TUser, CancellationToken)
Gets a list of role names the specified user belongs to.
Declaration
public override Task<IList<string>> GetRolesAsync(TUser user, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<IList<System.String>> |
|
View Source
GetSecurityStampAsync(TUser, CancellationToken)
Declaration
public override Task<string> GetSecurityStampAsync(TUser user, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.String> |
|
View Source
GetUsersForClaimAsync(Claim, CancellationToken)
Declaration
public override Task<IList<TUser>> GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
System.Security.Claims.Claim |
claim |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<IList<TUser>> |
|
View Source
HasPasswordAsync(TUser, CancellationToken)
Declaration
public override async Task<bool> HasPasswordAsync(TUser user, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.Boolean> |
|
View Source
IsInRoleAsync(TUser, String, CancellationToken)
Returns true if a user is in the role
Declaration
public override Task<bool> IsInRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
normalizedRoleName |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.Boolean> |
|
View Source
RemoveClaimsAsync(TUser, IEnumerable<Claim>, CancellationToken)
Declaration
public override Task RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
IEnumerable<System.Security.Claims.Claim> |
claims |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
RemoveFromRoleAsync(TUser, String, CancellationToken)
Removes the role (user group) for the user
Declaration
public override Task RemoveFromRoleAsync(TUser user, string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
normalizedRoleName |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
RemoveUserTokenAsync(IdentityUserToken<String>)
Not supported in Umbraco, see comments above on GetTokenAsync, RemoveTokenAsync, SetTokenAsync
Declaration
protected override Task RemoveUserTokenAsync(IdentityUserToken<string> token)
Parameters
Type |
Name |
Description |
Umbraco.Cms.Core.Security.IdentityUserToken<System.String> |
token |
|
Returns
View Source
ReplaceClaimAsync(TUser, Claim, Claim, CancellationToken)
Declaration
public override Task ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.Security.Claims.Claim |
claim |
|
System.Security.Claims.Claim |
newClaim |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
SetNormalizedEmailAsync(TUser, String, CancellationToken)
Declaration
public override Task SetNormalizedEmailAsync(TUser user, string normalizedEmail, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
normalizedEmail |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
SetNormalizedUserNameAsync(TUser, String, CancellationToken)
Declaration
public override Task SetNormalizedUserNameAsync(TUser user, string normalizedName, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
normalizedName |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
SetPasswordHashAsync(TUser, String, CancellationToken)
Declaration
public override async Task SetPasswordHashAsync(TUser user, string passwordHash, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
TUser |
user |
|
System.String |
passwordHash |
|
CancellationToken |
cancellationToken |
|
Returns
View Source
UserIdToInt(String)
Declaration
protected static int UserIdToInt(string userId)
Parameters
Type |
Name |
Description |
System.String |
userId |
|
Returns
Type |
Description |
System.Int32 |
|
View Source
UserIdToString(Int32)
Declaration
protected static string UserIdToString(int userId)
Parameters
Type |
Name |
Description |
System.Int32 |
userId |
|
Returns
Type |
Description |
System.String |
|