diff --git a/src/Microsoft.AspNet.Identity.Entity/IdentityRole.cs b/src/Microsoft.AspNet.Identity.Entity/IdentityRole.cs
index b4dcdf61aa..343f3b1877 100644
--- a/src/Microsoft.AspNet.Identity.Entity/IdentityRole.cs
+++ b/src/Microsoft.AspNet.Identity.Entity/IdentityRole.cs
@@ -32,7 +32,7 @@ namespace Microsoft.AspNet.Identity.Entity
///
///
///
- public class IdentityRole : IRole
+ public class IdentityRole
where TUserRole : IdentityUserRole
where TKey : IEquatable
{
diff --git a/src/Microsoft.AspNet.Identity.Entity/IdentityUser.cs b/src/Microsoft.AspNet.Identity.Entity/IdentityUser.cs
index a718931db6..c0c94ef814 100644
--- a/src/Microsoft.AspNet.Identity.Entity/IdentityUser.cs
+++ b/src/Microsoft.AspNet.Identity.Entity/IdentityUser.cs
@@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Identity.Entity
}
}
- public class IdentityUser : IUser
+ public class IdentityUser
where TLogin : IdentityUserLogin
where TRole : IdentityUserRole
where TClaim : IdentityUserClaim
diff --git a/src/Microsoft.AspNet.Identity.Entity/RoleStore.cs b/src/Microsoft.AspNet.Identity.Entity/RoleStore.cs
index bee18805b6..4813aebf66 100644
--- a/src/Microsoft.AspNet.Identity.Entity/RoleStore.cs
+++ b/src/Microsoft.AspNet.Identity.Entity/RoleStore.cs
@@ -8,8 +8,8 @@ using Microsoft.Data.Entity;
namespace Microsoft.AspNet.Identity.Entity
{
public class RoleStore :
- IQueryableRoleStore
- where TRole : class,IRole
+ IQueryableRoleStore
+ where TRole : IdentityRole
where TKey : IEquatable
{
private bool _disposed;
@@ -80,17 +80,34 @@ namespace Microsoft.AspNet.Identity.Entity
await SaveChanges(cancellationToken);
}
+ public Task GetRoleId(TRole role, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(role.Id);
+ }
+
+ public Task GetRoleName(TRole role, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(role.Name);
+ }
+
+
+ public virtual TKey ConvertId(string userId)
+ {
+ return (TKey)Convert.ChangeType(userId, typeof(TKey));
+ }
+
///
/// Find a role by id
///
///
///
///
- public virtual Task FindById(TKey id, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual Task FindById(string id, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
- return Roles.SingleOrDefaultAsync(r => r.Id.Equals(id), cancellationToken);
+ var roleId = ConvertId(id);
+ return Roles.SingleOrDefaultAsync(r => r.Id.Equals(roleId), cancellationToken);
//return GetRoleAggregate(u => u.Id.Equals(id));
}
diff --git a/src/Microsoft.AspNet.Identity.Entity/UserStore.cs b/src/Microsoft.AspNet.Identity.Entity/UserStore.cs
index e87c4bdf08..217074c2b8 100644
--- a/src/Microsoft.AspNet.Identity.Entity/UserStore.cs
+++ b/src/Microsoft.AspNet.Identity.Entity/UserStore.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.Linq;
using System.Linq.Expressions;
using System.Security.Claims;
@@ -16,16 +17,16 @@ namespace Microsoft.AspNet.Identity.Entity
}
public class UserStore :
- IUserLoginStore,
- IUserClaimStore,
- IUserRoleStore,
- IUserPasswordStore,
- IUserSecurityStampStore,
- IQueryableUserStore,
- IUserEmailStore,
- IUserPhoneNumberStore,
- IUserTwoFactorStore,
- IUserLockoutStore
+ IUserLoginStore,
+ IUserClaimStore,
+ IUserRoleStore,
+ IUserPasswordStore,
+ IUserSecurityStampStore,
+ IQueryableUserStore,
+ IUserEmailStore,
+ IUserPhoneNumberStore,
+ IUserTwoFactorStore,
+ IUserLockoutStore
where TKey : IEquatable
where TUser : IdentityUser
where TRole : IdentityRole
@@ -65,6 +66,16 @@ namespace Microsoft.AspNet.Identity.Entity
//.Include(u => u.Logins)
}
+ public Task GetUserId(TUser user, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(Convert.ToString(user.Id, CultureInfo.InvariantCulture));
+ }
+
+ public Task GetUserName(TUser user, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(user.UserName);
+ }
+
public async virtual Task Create(TUser user, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
@@ -101,17 +112,23 @@ namespace Microsoft.AspNet.Identity.Entity
await SaveChanges(cancellationToken);
}
+ public virtual TKey ConvertUserId(string userId)
+ {
+ return (TKey)Convert.ChangeType(userId, typeof(TKey));
+ }
+
///
/// Find a user by id
///
///
///
///
- public virtual Task FindById(TKey userId, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual Task FindById(string userId, CancellationToken cancellationToken = default(CancellationToken))
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
- return Users.SingleOrDefaultAsync(u => u.Id.Equals(userId), cancellationToken);
+ var id = ConvertUserId(userId);
+ return Users.SingleOrDefaultAsync(u => u.Id.Equals(id), cancellationToken);
// TODO: return GetUserAggregate(u => u.Id.Equals(userId), cancellationToken);
}
diff --git a/src/Microsoft.AspNet.Identity.InMemory/InMemoryRole.cs b/src/Microsoft.AspNet.Identity.InMemory/InMemoryRole.cs
index a4efda043e..524df35610 100644
--- a/src/Microsoft.AspNet.Identity.InMemory/InMemoryRole.cs
+++ b/src/Microsoft.AspNet.Identity.InMemory/InMemoryRole.cs
@@ -2,7 +2,7 @@ using System;
namespace Microsoft.AspNet.Identity.InMemory
{
- public class InMemoryRole : IRole
+ public class InMemoryRole
{
public InMemoryRole(string roleName)
{
diff --git a/src/Microsoft.AspNet.Identity.InMemory/InMemoryRoleStore.cs b/src/Microsoft.AspNet.Identity.InMemory/InMemoryRoleStore.cs
index 665d2a4b09..0ff53eb7f9 100644
--- a/src/Microsoft.AspNet.Identity.InMemory/InMemoryRoleStore.cs
+++ b/src/Microsoft.AspNet.Identity.InMemory/InMemoryRoleStore.cs
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNet.Identity.InMemory
{
- public class InMemoryRoleStore : IQueryableRoleStore where TRole : class,IRole
+ public class InMemoryRoleStore : IQueryableRoleStore where TRole : InMemoryRole
{
private readonly Dictionary _roles = new Dictionary();
@@ -27,6 +27,16 @@ namespace Microsoft.AspNet.Identity.InMemory
return Task.FromResult(0);
}
+ public Task GetRoleId(TRole role, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(role.Id);
+ }
+
+ public Task GetRoleName(TRole role, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(role.Name);
+ }
+
public Task Update(TRole role, CancellationToken cancellationToken = default(CancellationToken))
{
_roles[role.Id] = role;
diff --git a/src/Microsoft.AspNet.Identity.InMemory/InMemoryUser.cs b/src/Microsoft.AspNet.Identity.InMemory/InMemoryUser.cs
index f9e18f29a7..9d9cd8b3cd 100644
--- a/src/Microsoft.AspNet.Identity.InMemory/InMemoryUser.cs
+++ b/src/Microsoft.AspNet.Identity.InMemory/InMemoryUser.cs
@@ -4,7 +4,7 @@ using System.Security.Claims;
namespace Microsoft.AspNet.Identity.InMemory
{
- public class InMemoryUser : IUser
+ public class InMemoryUser
{
private readonly IList _claims;
private readonly IList _logins;
diff --git a/src/Microsoft.AspNet.Identity.InMemory/InMemoryUserStore.cs b/src/Microsoft.AspNet.Identity.InMemory/InMemoryUserStore.cs
index b1c0782385..f343799506 100644
--- a/src/Microsoft.AspNet.Identity.InMemory/InMemoryUserStore.cs
+++ b/src/Microsoft.AspNet.Identity.InMemory/InMemoryUserStore.cs
@@ -8,16 +8,16 @@ using System.Threading.Tasks;
namespace Microsoft.AspNet.Identity.InMemory
{
public class InMemoryUserStore :
- IUserLoginStore,
- IUserRoleStore,
- IUserClaimStore,
- IUserPasswordStore,
- IUserSecurityStampStore,
- IUserEmailStore,
- IUserLockoutStore,
- IUserPhoneNumberStore,
- IQueryableUserStore,
- IUserTwoFactorStore
+ IUserLoginStore,
+ IUserRoleStore,
+ IUserClaimStore,
+ IUserPasswordStore,
+ IUserSecurityStampStore,
+ IUserEmailStore,
+ IUserLockoutStore,
+ IUserPhoneNumberStore,
+ IQueryableUserStore,
+ IUserTwoFactorStore
where TUser : InMemoryUser
{
private readonly Dictionary _logins =
@@ -149,6 +149,16 @@ namespace Microsoft.AspNet.Identity.InMemory
return Task.FromResult(null);
}
+ public Task GetUserId(TUser user, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(user.Id);
+ }
+
+ public Task GetUserName(TUser user, CancellationToken cancellationToken = new CancellationToken())
+ {
+ return Task.FromResult(user.UserName);
+ }
+
public Task Create(TUser user, CancellationToken cancellationToken = default(CancellationToken))
{
_users[user.Id] = user;
diff --git a/src/Microsoft.AspNet.Identity.Security/SignInManager.cs b/src/Microsoft.AspNet.Identity.Security/SignInManager.cs
index 721cb98ce1..b4e0e9cfec 100644
--- a/src/Microsoft.AspNet.Identity.Security/SignInManager.cs
+++ b/src/Microsoft.AspNet.Identity.Security/SignInManager.cs
@@ -7,9 +7,7 @@ using Microsoft.AspNet.Abstractions.Security;
namespace Microsoft.AspNet.Identity.Security
{
- public class SignInManager
- where TUser : class, IUser
- where TKey : IEquatable
+ public class SignInManager where TUser : class
{
private string _authType;
public string AuthenticationType
@@ -18,7 +16,7 @@ namespace Microsoft.AspNet.Identity.Security
set { _authType = value; }
}
- public UserManager UserManager { get; set; }
+ public UserManager UserManager { get; set; }
public HttpContext Context { get; set; }
@@ -139,7 +137,9 @@ namespace Microsoft.AspNet.Identity.Security
{
return SignInStatus.Failure;
}
- if (await UserManager.IsLockedOut(user.Id))
+ // TODO: overloads taking TUser?
+ var userId = await UserManager.GetUserId(user);
+ if (await UserManager.IsLockedOut(userId))
{
return SignInStatus.LockedOut;
}
@@ -152,8 +152,8 @@ namespace Microsoft.AspNet.Identity.Security
if (shouldLockout)
{
// If lockout is requested, increment access failed count which might lock out the user
- await UserManager.AccessFailed(user.Id);
- if (await UserManager.IsLockedOut(user.Id))
+ await UserManager.AccessFailed(userId);
+ if (await UserManager.IsLockedOut(userId))
{
return SignInStatus.LockedOut;
}
diff --git a/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs b/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs
index fe2dd0a4ad..37f5d892dc 100644
--- a/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs
+++ b/src/Microsoft.AspNet.Identity/ClaimsIdentityFactory.cs
@@ -10,10 +10,8 @@ namespace Microsoft.AspNet.Identity
/// Creates a ClaimsIdentity from a User
///
///
- ///
- public class ClaimsIdentityFactory : IClaimsIdentityFactory
- where TUser : class, IUser
- where TKey : IEquatable
+ public class ClaimsIdentityFactory : IClaimsIdentityFactory
+ where TUser : class
{
///
/// ClaimType used for the security stamp by default
@@ -57,8 +55,9 @@ namespace Microsoft.AspNet.Identity
///
///
///
+ ///
///
- public virtual async Task Create(UserManager manager, TUser user,
+ public virtual async Task Create(UserManager manager, TUser user,
string authenticationType, CancellationToken cancellationToken = default(CancellationToken))
{
if (manager == null)
@@ -69,16 +68,18 @@ namespace Microsoft.AspNet.Identity
{
throw new ArgumentNullException("user");
}
+ var userId = await manager.GetUserId(user, cancellationToken);
+ var userName = await manager.GetUserName(user, cancellationToken);
var id = new ClaimsIdentity(authenticationType, UserNameClaimType, RoleClaimType);
- id.AddClaim(new Claim(UserIdClaimType, Convert.ToString(user.Id, CultureInfo.InvariantCulture), ClaimValueTypes.String));
- id.AddClaim(new Claim(UserNameClaimType, user.UserName, ClaimValueTypes.String));
+ id.AddClaim(new Claim(UserIdClaimType, userId));
+ id.AddClaim(new Claim(UserNameClaimType, userName, ClaimValueTypes.String));
if (manager.SupportsUserSecurityStamp)
{
- id.AddClaim(new Claim(SecurityStampClaimType, await manager.GetSecurityStamp(user.Id, cancellationToken)));
+ id.AddClaim(new Claim(SecurityStampClaimType, await manager.GetSecurityStamp(userId, cancellationToken)));
}
if (manager.SupportsUserRole)
{
- var roles = await manager.GetRoles(user.Id, cancellationToken);
+ var roles = await manager.GetRoles(userId, cancellationToken);
foreach (var roleName in roles)
{
id.AddClaim(new Claim(RoleClaimType, roleName, ClaimValueTypes.String));
@@ -86,7 +87,7 @@ namespace Microsoft.AspNet.Identity
}
if (manager.SupportsUserClaim)
{
- id.AddClaims(await manager.GetClaims(user.Id, cancellationToken));
+ id.AddClaims(await manager.GetClaims(userId, cancellationToken));
}
return id;
}
diff --git a/src/Microsoft.AspNet.Identity/IClaimsIdentityFactory.cs b/src/Microsoft.AspNet.Identity/IClaimsIdentityFactory.cs
index 1a029c9b59..6e8f15ce4b 100644
--- a/src/Microsoft.AspNet.Identity/IClaimsIdentityFactory.cs
+++ b/src/Microsoft.AspNet.Identity/IClaimsIdentityFactory.cs
@@ -9,10 +9,8 @@ namespace Microsoft.AspNet.Identity
/// Interface for creating a ClaimsIdentity from an IUser
///
///
- ///
- public interface IClaimsIdentityFactory
- where TUser : class, IUser
- where TKey : IEquatable
+ public interface IClaimsIdentityFactory
+ where TUser : class
{
///
/// Create a ClaimsIdentity from an user using a UserManager
@@ -22,6 +20,6 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task Create(UserManager manager, TUser user, string authenticationType, CancellationToken cancellationToken = default(CancellationToken));
+ Task Create(UserManager manager, TUser user, string authenticationType, CancellationToken cancellationToken = default(CancellationToken));
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IQueryableRoleStore.cs b/src/Microsoft.AspNet.Identity/IQueryableRoleStore.cs
index 93c30f3a92..3c49d04c32 100644
--- a/src/Microsoft.AspNet.Identity/IQueryableRoleStore.cs
+++ b/src/Microsoft.AspNet.Identity/IQueryableRoleStore.cs
@@ -6,16 +6,7 @@ namespace Microsoft.AspNet.Identity
/// Interface that exposes an IQueryable roles
///
///
- public interface IQueryableRoleStore : IQueryableRoleStore where TRole : IRole
- {
- }
-
- ///
- /// Interface that exposes an IQueryable roles
- ///
- ///
- ///
- public interface IQueryableRoleStore : IRoleStore where TRole : IRole
+ public interface IQueryableRoleStore : IRoleStore where TRole : class
{
///
/// IQueryable users
diff --git a/src/Microsoft.AspNet.Identity/IQueryableUserStore.cs b/src/Microsoft.AspNet.Identity/IQueryableUserStore.cs
index d8e26b7e6b..43af7e86f9 100644
--- a/src/Microsoft.AspNet.Identity/IQueryableUserStore.cs
+++ b/src/Microsoft.AspNet.Identity/IQueryableUserStore.cs
@@ -2,20 +2,12 @@
namespace Microsoft.AspNet.Identity
{
- ///
- /// Interface that exposes an IQueryable users
- ///
- ///
- public interface IQueryableUserStore : IQueryableUserStore where TUser : class, IUser
- {
- }
-
///
/// Interface that exposes an IQueryable users
///
///
///
- public interface IQueryableUserStore : IUserStore where TUser : class, IUser
+ public interface IQueryableUserStore : IUserStore where TUser : class
{
///
/// IQueryable users
diff --git a/src/Microsoft.AspNet.Identity/IRole.cs b/src/Microsoft.AspNet.Identity/IRole.cs
index 8cebb0189c..01b724ccac 100644
--- a/src/Microsoft.AspNet.Identity/IRole.cs
+++ b/src/Microsoft.AspNet.Identity/IRole.cs
@@ -1,19 +1,19 @@
-namespace Microsoft.AspNet.Identity
-{
- ///
- /// Mimimal set of data needed to persist role data
- ///
- ///
- public interface IRole
- {
- ///
- /// Id of the role
- ///
- TKey Id { get; }
+//namespace Microsoft.AspNet.Identity
+//{
+// ///
+// /// Mimimal set of data needed to persist role data
+// ///
+// ///
+// public interface IRole
+// {
+// ///
+// /// Id of the role
+// ///
+// TKey Id { get; }
- ///
- /// Name of the role
- ///
- string Name { get; set; }
- }
-}
\ No newline at end of file
+// ///
+// /// Name of the role
+// ///
+// string Name { get; set; }
+// }
+//}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IRoleStore.cs b/src/Microsoft.AspNet.Identity/IRoleStore.cs
index 7205a9deff..04e9a600e6 100644
--- a/src/Microsoft.AspNet.Identity/IRoleStore.cs
+++ b/src/Microsoft.AspNet.Identity/IRoleStore.cs
@@ -8,8 +8,7 @@ namespace Microsoft.AspNet.Identity
/// Interface that exposes basic role management
///
///
- ///
- public interface IRoleStore : IDisposable where TRole : IRole
+ public interface IRoleStore : IDisposable where TRole : class
{
///
/// Insert a new role
@@ -35,13 +34,29 @@ namespace Microsoft.AspNet.Identity
///
Task Delete(TRole role, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns a role's id
+ ///
+ ///
+ ///
+ ///
+ Task GetRoleId(TRole role, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Returns a role's name
+ ///
+ ///
+ ///
+ ///
+ Task GetRoleName(TRole role, CancellationToken cancellationToken = default(CancellationToken));
+
///
/// Finds a role by id
///
///
///
///
- Task FindById(TKey roleId, CancellationToken cancellationToken = default(CancellationToken));
+ Task FindById(string roleId, CancellationToken cancellationToken = default(CancellationToken));
///
/// Find a role by name
diff --git a/src/Microsoft.AspNet.Identity/IRoleValidator.cs b/src/Microsoft.AspNet.Identity/IRoleValidator.cs
index b41c6f6305..71bdef4d66 100644
--- a/src/Microsoft.AspNet.Identity/IRoleValidator.cs
+++ b/src/Microsoft.AspNet.Identity/IRoleValidator.cs
@@ -9,9 +9,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public interface IRoleValidator
- where TRole : class, IRole
- where TKey : IEquatable
+ public interface IRoleValidator where TRole : class
{
///
/// Validate the user
@@ -20,6 +18,6 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task Validate(RoleManager manager, TRole role, CancellationToken cancellationToken = default(CancellationToken));
+ Task Validate(RoleManager manager, TRole role, CancellationToken cancellationToken = default(CancellationToken));
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IUser.cs b/src/Microsoft.AspNet.Identity/IUser.cs
index 432c76534e..81030f66b8 100644
--- a/src/Microsoft.AspNet.Identity/IUser.cs
+++ b/src/Microsoft.AspNet.Identity/IUser.cs
@@ -1,19 +1,19 @@
-namespace Microsoft.AspNet.Identity
-{
- ///
- /// Minimal interface for a user with id and username
- ///
- ///
- public interface IUser
- {
- ///
- /// Unique key for the user
- ///
- TKey Id { get; }
+//namespace Microsoft.AspNet.Identity
+//{
+// ///
+// /// Minimal interface for a user with id and username
+// ///
+// ///
+// public interface IUser
+// {
+// ///
+// /// Unique key for the user
+// ///
+// TKey Id { get; }
- ///
- /// Unique username
- ///
- string UserName { get; set; }
- }
-}
\ No newline at end of file
+// ///
+// /// Unique username
+// ///
+// string UserName { get; set; }
+// }
+//}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IUserClaimStore.cs b/src/Microsoft.AspNet.Identity/IUserClaimStore.cs
index f2e50e2959..af914c2b36 100644
--- a/src/Microsoft.AspNet.Identity/IUserClaimStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserClaimStore.cs
@@ -9,8 +9,7 @@ namespace Microsoft.AspNet.Identity
/// Stores user specific claims
///
///
- ///
- public interface IUserClaimStore : IUserStore where TUser : class, IUser
+ public interface IUserClaimStore : IUserStore where TUser : class
{
///
/// Returns the claims for the user with the issuer set
diff --git a/src/Microsoft.AspNet.Identity/IUserEmailStore.cs b/src/Microsoft.AspNet.Identity/IUserEmailStore.cs
index bd18f09d25..50671587c6 100644
--- a/src/Microsoft.AspNet.Identity/IUserEmailStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserEmailStore.cs
@@ -7,8 +7,7 @@ namespace Microsoft.AspNet.Identity
/// Stores a user's email
///
///
- ///
- public interface IUserEmailStore : IUserStore where TUser : class, IUser
+ public interface IUserEmailStore : IUserStore where TUser : class
{
///
/// Set the user email
diff --git a/src/Microsoft.AspNet.Identity/IUserLockoutStore.cs b/src/Microsoft.AspNet.Identity/IUserLockoutStore.cs
index b40e6f07dc..93bd3cd20d 100644
--- a/src/Microsoft.AspNet.Identity/IUserLockoutStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserLockoutStore.cs
@@ -8,8 +8,7 @@ namespace Microsoft.AspNet.Identity
/// Stores information which can be used to implement account lockout, including access failures and lockout status
///
///
- ///
- public interface IUserLockoutStore : IUserStore where TUser : class, IUser
+ public interface IUserLockoutStore : IUserStore where TUser : class
{
///
/// Returns the DateTimeOffset that represents the end of a user's lockout, any time in the past should be considered
diff --git a/src/Microsoft.AspNet.Identity/IUserLoginStore.cs b/src/Microsoft.AspNet.Identity/IUserLoginStore.cs
index a5f19f5b80..b38c490507 100644
--- a/src/Microsoft.AspNet.Identity/IUserLoginStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserLoginStore.cs
@@ -8,8 +8,7 @@ namespace Microsoft.AspNet.Identity
/// Interface that maps users to login providers, i.e. Google, Facebook, Twitter, Microsoft
///
///
- ///
- public interface IUserLoginStore : IUserStore where TUser : class, IUser
+ public interface IUserLoginStore : IUserStore where TUser : class
{
///
/// Adds a user login with the specified provider and key
diff --git a/src/Microsoft.AspNet.Identity/IUserNameStore.cs b/src/Microsoft.AspNet.Identity/IUserNameStore.cs
new file mode 100644
index 0000000000..885198b37c
--- /dev/null
+++ b/src/Microsoft.AspNet.Identity/IUserNameStore.cs
@@ -0,0 +1,37 @@
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Microsoft.AspNet.Identity
+{
+ ///
+ /// Stores a user's email
+ ///
+ ///
+ public interface IUserNameStore : IUserStore where TUser : class
+ {
+ ///
+ /// Set the user name
+ ///
+ ///
+ ///
+ ///
+ ///
+ Task SetUserName(TUser user, string userName, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Get the user name
+ ///
+ ///
+ ///
+ ///
+ Task GetUserName(TUser user, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Returns the user associated with this name
+ ///
+ ///
+ ///
+ ///
+ Task FindByName(string name, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IUserPasswordStore.cs b/src/Microsoft.AspNet.Identity/IUserPasswordStore.cs
index 2c4c343815..48f6a694ce 100644
--- a/src/Microsoft.AspNet.Identity/IUserPasswordStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserPasswordStore.cs
@@ -7,8 +7,7 @@ namespace Microsoft.AspNet.Identity
/// Stores a user's password hash
///
///
- ///
- public interface IUserPasswordStore : IUserStore where TUser : class, IUser
+ public interface IUserPasswordStore : IUserStore where TUser : class
{
///
/// Set the user password hash
diff --git a/src/Microsoft.AspNet.Identity/IUserPhoneNumberStore.cs b/src/Microsoft.AspNet.Identity/IUserPhoneNumberStore.cs
index f342f00be5..4246136693 100644
--- a/src/Microsoft.AspNet.Identity/IUserPhoneNumberStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserPhoneNumberStore.cs
@@ -7,8 +7,7 @@ namespace Microsoft.AspNet.Identity
/// Stores a user's phoneNumber
///
///
- ///
- public interface IUserPhoneNumberStore : IUserStore where TUser : class, IUser
+ public interface IUserPhoneNumberStore : IUserStore where TUser : class
{
///
/// Set the user PhoneNumber
diff --git a/src/Microsoft.AspNet.Identity/IUserRoleStore.cs b/src/Microsoft.AspNet.Identity/IUserRoleStore.cs
index 180c74c287..7e135f3699 100644
--- a/src/Microsoft.AspNet.Identity/IUserRoleStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserRoleStore.cs
@@ -8,8 +8,7 @@ namespace Microsoft.AspNet.Identity
/// Interface that maps users to their roles
///
///
- ///
- public interface IUserRoleStore : IUserStore where TUser : class, IUser
+ public interface IUserRoleStore : IUserStore where TUser : class
{
///
/// Adds a user to role
diff --git a/src/Microsoft.AspNet.Identity/IUserSecurityStampStore.cs b/src/Microsoft.AspNet.Identity/IUserSecurityStampStore.cs
index db79cf58d2..5f7596a02b 100644
--- a/src/Microsoft.AspNet.Identity/IUserSecurityStampStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserSecurityStampStore.cs
@@ -7,8 +7,7 @@ namespace Microsoft.AspNet.Identity
/// Stores a user's security stamp
///
///
- ///
- public interface IUserSecurityStampStore : IUserStore where TUser : class, IUser
+ public interface IUserSecurityStampStore : IUserStore where TUser : class
{
///
/// Set the security stamp for the user
diff --git a/src/Microsoft.AspNet.Identity/IUserStore.cs b/src/Microsoft.AspNet.Identity/IUserStore.cs
index e6b857411f..a030602824 100644
--- a/src/Microsoft.AspNet.Identity/IUserStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserStore.cs
@@ -9,8 +9,24 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public interface IUserStore : IDisposable where TUser : class, IUser
+ public interface IUserStore : IDisposable where TUser : class
{
+ ///
+ /// Returns the user id for a user
+ ///
+ ///
+ ///
+ ///
+ Task GetUserId(TUser user, CancellationToken cancellationToken = default(CancellationToken));
+
+ ///
+ /// Returns the user's name
+ ///
+ ///
+ ///
+ ///
+ Task GetUserName(TUser user, CancellationToken cancellationToken = default(CancellationToken));
+
///
/// Insert a new user
///
@@ -41,14 +57,15 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task FindById(TKey userId, CancellationToken cancellationToken = default(CancellationToken));
+ Task FindById(string userId, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Find a user by name
+ /// Returns the user associated with this name
///
- ///
+ ///
///
///
- Task FindByName(string userName, CancellationToken cancellationToken = default(CancellationToken));
+ Task FindByName(string name, CancellationToken cancellationToken = default(CancellationToken));
+
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IUserTokenProvider.cs b/src/Microsoft.AspNet.Identity/IUserTokenProvider.cs
index 1595237e53..27ef69fa94 100644
--- a/src/Microsoft.AspNet.Identity/IUserTokenProvider.cs
+++ b/src/Microsoft.AspNet.Identity/IUserTokenProvider.cs
@@ -7,7 +7,7 @@ namespace Microsoft.AspNet.Identity
///
/// Interface to generate user tokens
///
- public interface IUserTokenProvider where TUser : class, IUser where TKey : IEquatable
+ public interface IUserTokenProvider where TUser : class
{
///
/// Generate a token for a user
@@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task Generate(string purpose, UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
+ Task Generate(string purpose, UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
///
/// Validate and unprotect a token, returns null if invalid
@@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task Validate(string purpose, string token, UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
+ Task Validate(string purpose, string token, UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
///
/// Notifies the user that a token has been generated, i.e. via email or sms, or can no-op
@@ -38,7 +38,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task Notify(string token, UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
+ Task Notify(string token, UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
///
/// Returns true if provider can be used for this user, i.e. could require a user to have an email
@@ -47,6 +47,6 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task IsValidProviderForUser(UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
+ Task IsValidProviderForUser(UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/IUserTwoFactorStore.cs b/src/Microsoft.AspNet.Identity/IUserTwoFactorStore.cs
index f7384eb90d..8f85a62ed3 100644
--- a/src/Microsoft.AspNet.Identity/IUserTwoFactorStore.cs
+++ b/src/Microsoft.AspNet.Identity/IUserTwoFactorStore.cs
@@ -7,8 +7,7 @@ namespace Microsoft.AspNet.Identity
/// Stores whether two factor is enabled for a user
///
///
- ///
- public interface IUserTwoFactorStore : IUserStore where TUser : class, IUser
+ public interface IUserTwoFactorStore : IUserStore where TUser : class
{
///
/// Sets whether two factor is enabled for the user
diff --git a/src/Microsoft.AspNet.Identity/IUserValidator.cs b/src/Microsoft.AspNet.Identity/IUserValidator.cs
index 3d72915f62..e4d64da6c3 100644
--- a/src/Microsoft.AspNet.Identity/IUserValidator.cs
+++ b/src/Microsoft.AspNet.Identity/IUserValidator.cs
@@ -8,10 +8,7 @@ namespace Microsoft.AspNet.Identity
/// Used to validate a user
///
///
- ///
- public interface IUserValidator
- where TUser : class, IUser
- where TKey : IEquatable
+ public interface IUserValidator where TUser : class
{
///
/// Validate the user
@@ -20,6 +17,6 @@ namespace Microsoft.AspNet.Identity
///
///
///
- Task Validate(UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
+ Task Validate(UserManager manager, TUser user, CancellationToken cancellationToken = default(CancellationToken));
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNet.Identity/RoleManager.cs b/src/Microsoft.AspNet.Identity/RoleManager.cs
index 535e574ba6..909c2030a8 100644
--- a/src/Microsoft.AspNet.Identity/RoleManager.cs
+++ b/src/Microsoft.AspNet.Identity/RoleManager.cs
@@ -9,26 +9,7 @@ namespace Microsoft.AspNet.Identity
/// Exposes role related api which will automatically save changes to the RoleStore
///
///
- public class RoleManager : RoleManager where TRole : class, IRole
- {
- ///
- /// Constructor
- ///
- ///
- public RoleManager(IRoleStore store)
- : base(store)
- {
- }
- }
-
- ///
- /// Exposes role related api which will automatically save changes to the RoleStore
- ///
- ///
- ///
- public class RoleManager : IDisposable
- where TRole : class, IRole
- where TKey : IEquatable
+ public class RoleManager : IDisposable where TRole : class
{
private bool _disposed;
@@ -36,25 +17,25 @@ namespace Microsoft.AspNet.Identity
/// Constructor
///
/// The IRoleStore is responsible for commiting changes via the UpdateAsync/CreateAsync methods
- public RoleManager(IRoleStore store)
+ public RoleManager(IRoleStore store)
{
if (store == null)
{
throw new ArgumentNullException("store");
}
Store = store;
- RoleValidator = new RoleValidator();
+ RoleValidator = new RoleValidator();
}
///
/// Persistence abstraction that the Manager operates against
///
- protected IRoleStore Store { get; private set; }
+ protected IRoleStore Store { get; private set; }
///
/// Used to validate roles before persisting changes
///
- public IRoleValidator RoleValidator { get; set; }
+ public IRoleValidator RoleValidator { get; set; }
///
/// Returns an IQueryable of roles if the store is an IQueryableRoleStore
@@ -63,7 +44,7 @@ namespace Microsoft.AspNet.Identity
{
get
{
- var queryableStore = Store as IQueryableRoleStore;
+ var queryableStore = Store as IQueryableRoleStore;
if (queryableStore == null)
{
throw new NotSupportedException(Resources.StoreNotIQueryableRoleStore);
@@ -80,7 +61,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IQueryableRoleStore;
+ return Store is IQueryableRoleStore;
}
}
@@ -185,12 +166,36 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual async Task FindById(TKey roleId, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual async Task FindById(string roleId, CancellationToken cancellationToken = default(CancellationToken))
{
ThrowIfDisposed();
return await Store.FindById(roleId, cancellationToken);
}
+ ///
+ /// Return the name of the role
+ ///
+ ///
+ ///
+ ///
+ public virtual async Task GetRoleName(TRole role, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ ThrowIfDisposed();
+ return await Store.GetRoleName(role, cancellationToken);
+ }
+
+ ///
+ /// Return the role id for a role
+ ///
+ ///
+ ///
+ ///
+ public virtual async Task GetRoleId(TRole role, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ ThrowIfDisposed();
+ return await Store.GetRoleId(role, cancellationToken);
+ }
+
///
/// Find a role by name
///
diff --git a/src/Microsoft.AspNet.Identity/RoleValidator.cs b/src/Microsoft.AspNet.Identity/RoleValidator.cs
index dcd649272a..1992bdb51c 100644
--- a/src/Microsoft.AspNet.Identity/RoleValidator.cs
+++ b/src/Microsoft.AspNet.Identity/RoleValidator.cs
@@ -10,10 +10,7 @@ namespace Microsoft.AspNet.Identity
/// Validates roles before they are saved
///
///
- ///
- public class RoleValidator : IRoleValidator
- where TRole : class, IRole
- where TKey : IEquatable
+ public class RoleValidator : IRoleValidator where TRole : class
{
///
/// Validates a role before saving
@@ -22,7 +19,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual async Task Validate(RoleManager manager, TRole role, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual async Task Validate(RoleManager manager, TRole role, CancellationToken cancellationToken = default(CancellationToken))
{
if (manager == null)
{
@@ -41,19 +38,20 @@ namespace Microsoft.AspNet.Identity
return IdentityResult.Success;
}
- private static async Task ValidateRoleName(RoleManager manager, TRole role,
+ private static async Task ValidateRoleName(RoleManager manager, TRole role,
ICollection errors)
{
- if (string.IsNullOrWhiteSpace(role.Name))
+ var roleName = await manager.GetRoleName(role);
+ if (string.IsNullOrWhiteSpace(roleName))
{
errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.PropertyTooShort, "Name"));
}
else
{
- var owner = await manager.FindByName(role.Name);
- if (owner != null && !EqualityComparer.Default.Equals(owner.Id, role.Id))
+ var owner = await manager.FindByName(roleName);
+ if (owner != null && !string.Equals(await manager.GetRoleId(owner), await manager.GetRoleId(role)))
{
- errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.DuplicateName, role.Name));
+ errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.DuplicateName, roleName));
}
}
}
diff --git a/src/Microsoft.AspNet.Identity/UserManager.cs b/src/Microsoft.AspNet.Identity/UserManager.cs
index 3863816ad6..ae0b96b264 100644
--- a/src/Microsoft.AspNet.Identity/UserManager.cs
+++ b/src/Microsoft.AspNet.Identity/UserManager.cs
@@ -14,15 +14,12 @@ namespace Microsoft.AspNet.Identity
/// Exposes user related api which will automatically save changes to the UserStore
///
///
- ///
- public class UserManager : IDisposable
- where TUser : class, IUser
- where TKey : IEquatable
+ public class UserManager : IDisposable where TUser : class
{
- private readonly Dictionary> _factors =
- new Dictionary>();
+ private readonly Dictionary> _factors =
+ new Dictionary>();
- private IClaimsIdentityFactory _claimsFactory;
+ private IClaimsIdentityFactory _claimsFactory;
private TimeSpan _defaultLockout = TimeSpan.Zero;
private bool _disposed;
private IPasswordHasher _passwordHasher;
@@ -40,10 +37,10 @@ namespace Microsoft.AspNet.Identity
throw new ArgumentNullException("serviceProvider");
}
PasswordHasher = serviceProvider.GetService();
- UserValidator = serviceProvider.GetService>();
+ UserValidator = serviceProvider.GetService>();
PasswordValidator = serviceProvider.GetService();
- ClaimsIdentityFactory = serviceProvider.GetService>();
- Store = serviceProvider.GetService>();
+ ClaimsIdentityFactory = serviceProvider.GetService>();
+ Store = serviceProvider.GetService>();
// TODO: maybe each optional store as well? Email and SMS services?
}
@@ -51,22 +48,22 @@ namespace Microsoft.AspNet.Identity
/// Constructor
///
/// The IUserStore is responsible for commiting changes via the UpdateAsync/CreateAsync methods
- public UserManager(IUserStore store)
+ public UserManager(IUserStore store)
{
if (store == null)
{
throw new ArgumentNullException("store");
}
Store = store;
- UserValidator = new UserValidator();
+ UserValidator = new UserValidator();
PasswordHasher = new PasswordHasher();
- ClaimsIdentityFactory = new ClaimsIdentityFactory();
+ ClaimsIdentityFactory = new ClaimsIdentityFactory();
}
///
/// Persistence abstraction that the Manager operates against
///
- protected internal IUserStore Store { get; set; }
+ protected internal IUserStore Store { get; set; }
///
/// Used to hash/verify passwords
@@ -92,7 +89,7 @@ namespace Microsoft.AspNet.Identity
///
/// Used to validate users before persisting changes
///
- public IUserValidator UserValidator { get; set; }
+ public IUserValidator UserValidator { get; set; }
///
/// Used to validate passwords before persisting changes
@@ -102,7 +99,7 @@ namespace Microsoft.AspNet.Identity
///
/// Used to create claims identities from users
///
- public IClaimsIdentityFactory ClaimsIdentityFactory
+ public IClaimsIdentityFactory ClaimsIdentityFactory
{
get
{
@@ -133,7 +130,7 @@ namespace Microsoft.AspNet.Identity
///
/// Used for generating ResetPassword and Confirmation Tokens
///
- public IUserTokenProvider UserTokenProvider { get; set; }
+ public IUserTokenProvider UserTokenProvider { get; set; }
///
/// If true, will enable user lockout when users are created
@@ -162,7 +159,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserTwoFactorStore;
+ return Store is IUserTwoFactorStore;
}
}
@@ -174,7 +171,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserPasswordStore;
+ return Store is IUserPasswordStore;
}
}
@@ -186,7 +183,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserSecurityStampStore;
+ return Store is IUserSecurityStampStore;
}
}
@@ -198,7 +195,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserRoleStore;
+ return Store is IUserRoleStore;
}
}
@@ -210,7 +207,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserLoginStore;
+ return Store is IUserLoginStore;
}
}
@@ -222,7 +219,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserEmailStore;
+ return Store is IUserEmailStore;
}
}
@@ -234,7 +231,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserPhoneNumberStore;
+ return Store is IUserPhoneNumberStore;
}
}
@@ -246,7 +243,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserClaimStore;
+ return Store is IUserClaimStore;
}
}
@@ -258,7 +255,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IUserLockoutStore;
+ return Store is IUserLockoutStore;
}
}
@@ -270,7 +267,7 @@ namespace Microsoft.AspNet.Identity
get
{
ThrowIfDisposed();
- return Store is IQueryableUserStore;
+ return Store is IQueryableUserStore;
}
}
@@ -281,7 +278,7 @@ namespace Microsoft.AspNet.Identity
{
get
{
- var queryableStore = Store as IQueryableUserStore;
+ var queryableStore = Store as IQueryableUserStore;
if (queryableStore == null)
{
throw new NotSupportedException(Resources.StoreNotIQueryableUserStore);
@@ -293,7 +290,7 @@ namespace Microsoft.AspNet.Identity
///
/// Dictionary mapping user two factor providers
///
- public IDictionary> TwoFactorProviders
+ public IDictionary> TwoFactorProviders
{
get { return _factors; }
}
@@ -399,7 +396,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual Task FindById(TKey userId, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual Task FindById(string userId, CancellationToken cancellationToken = default(CancellationToken))
{
ThrowIfDisposed();
return Store.FindById(userId, cancellationToken);
@@ -422,9 +419,9 @@ namespace Microsoft.AspNet.Identity
}
// IUserPasswordStore methods
- private IUserPasswordStore GetPasswordStore()
+ private IUserPasswordStore GetPasswordStore()
{
- var cast = Store as IUserPasswordStore;
+ var cast = Store as IUserPasswordStore;
if (cast == null)
{
throw new NotSupportedException(Resources.StoreNotIUserPasswordStore);
@@ -458,6 +455,30 @@ namespace Microsoft.AspNet.Identity
return await Create(user, cancellationToken);
}
+ ///
+ /// Get the user's name
+ ///
+ ///
+ ///
+ ///
+ public virtual async Task GetUserName(TUser user, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ ThrowIfDisposed();
+ return await Store.GetUserName(user, cancellationToken);
+ }
+
+ ///
+ /// Get the user's id
+ ///
+ ///
+ ///
+ ///
+ public virtual async Task GetUserId(TUser user, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ ThrowIfDisposed();
+ return await Store.GetUserId(user, cancellationToken);
+ }
+
///
/// Return a user with the specified username and password or null if there is no match.
///
@@ -500,7 +521,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual async Task HasPassword(TKey userId, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual async Task HasPassword(string userId, CancellationToken cancellationToken = default(CancellationToken))
{
ThrowIfDisposed();
var passwordStore = GetPasswordStore();
@@ -520,7 +541,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual async Task AddPassword(TKey userId, string password, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual async Task AddPassword(string userId, string password, CancellationToken cancellationToken = default(CancellationToken))
{
ThrowIfDisposed();
var passwordStore = GetPasswordStore();
@@ -551,7 +572,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual async Task ChangePassword(TKey userId, string currentPassword,
+ public virtual async Task ChangePassword(string userId, string currentPassword,
string newPassword, CancellationToken cancellationToken = default(CancellationToken))
{
ThrowIfDisposed();
@@ -580,7 +601,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- public virtual async Task RemovePassword(TKey userId, CancellationToken cancellationToken = default(CancellationToken))
+ public virtual async Task RemovePassword(string userId, CancellationToken cancellationToken = default(CancellationToken))
{
ThrowIfDisposed();
var passwordStore = GetPasswordStore();
@@ -595,7 +616,7 @@ namespace Microsoft.AspNet.Identity
return await Update(user, cancellationToken);
}
- internal async Task UpdatePasswordInternal(IUserPasswordStore passwordStore,
+ internal async Task UpdatePasswordInternal(IUserPasswordStore passwordStore,
TUser user, string newPassword, CancellationToken cancellationToken)
{
if (PasswordValidator != null)
@@ -620,7 +641,7 @@ namespace Microsoft.AspNet.Identity
///
///
///
- protected virtual async Task VerifyPassword(IUserPasswordStore store, TUser user,
+ protected virtual async Task VerifyPassword(IUserPasswordStore store, TUser user,
string password, CancellationToken cancellationToken = default(CancellationToken))
{
var hash = await store.GetPasswordHash(user, cancellationToken);
@@ -628,9 +649,9 @@ namespace Microsoft.AspNet.Identity
}
// IUserSecurityStampStore methods
- private IUserSecurityStampStore