Merge remote-tracking branch 'bch/dev' into bch-merge
This commit is contained in:
commit
855f7532ae
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Identity.CoreCompat
|
||||||
where TUser : IdentityUser
|
where TUser : IdentityUser
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default constuctor which uses a new instance of a default EntityDbContext.
|
/// Default constructor which uses a new instance of a default EntityDbContext.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public UserStore()
|
public UserStore()
|
||||||
: this(new IdentityDbContext<TUser>())
|
: this(new IdentityDbContext<TUser>())
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
/// Gets a flag indicating whether the backing user store supports a user authenticator.
|
/// Gets a flag indicating whether the backing user store supports a user authenticator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// true if the backing user store supports a user authenticatior, otherwise false.
|
/// true if the backing user store supports a user authenticator, otherwise false.
|
||||||
/// </value>
|
/// </value>
|
||||||
public virtual bool SupportsUserAuthenticatorKey
|
public virtual bool SupportsUserAuthenticatorKey
|
||||||
{
|
{
|
||||||
|
|
@ -193,7 +193,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
/// Gets a flag indicating whether the backing user store supports recovery codes.
|
/// Gets a flag indicating whether the backing user store supports recovery codes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>
|
/// <value>
|
||||||
/// true if the backing user store supports a user authenticatior, otherwise false.
|
/// true if the backing user store supports a user authenticator, otherwise false.
|
||||||
/// </value>
|
/// </value>
|
||||||
public virtual bool SupportsUserTwoFactorRecoveryCodes
|
public virtual bool SupportsUserTwoFactorRecoveryCodes
|
||||||
{
|
{
|
||||||
|
|
@ -961,7 +961,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
var existingUser = await FindByLoginAsync(login.LoginProvider, login.ProviderKey);
|
var existingUser = await FindByLoginAsync(login.LoginProvider, login.ProviderKey);
|
||||||
if (existingUser != null)
|
if (existingUser != null)
|
||||||
{
|
{
|
||||||
Logger.LogWarning(4, "AddLogin for user {userId} failed because it was already assocated with another user.", await GetUserIdAsync(user));
|
Logger.LogWarning(4, "AddLogin for user {userId} failed because it was already associated with another user.", await GetUserIdAsync(user));
|
||||||
return IdentityResult.Failed(ErrorDescriber.LoginAlreadyAssociated());
|
return IdentityResult.Failed(ErrorDescriber.LoginAlreadyAssociated());
|
||||||
}
|
}
|
||||||
await loginStore.AddLoginAsync(user, login, CancellationToken);
|
await loginStore.AddLoginAsync(user, login, CancellationToken);
|
||||||
|
|
|
||||||
|
|
@ -435,7 +435,7 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore
|
||||||
private DbSet<TRoleClaim> RoleClaims { get { return Context.Set<TRoleClaim>(); } }
|
private DbSet<TRoleClaim> RoleClaims { get { return Context.Set<TRoleClaim>(); } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a entity representing a role claim.
|
/// Creates an entity representing a role claim.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="role">The associated role.</param>
|
/// <param name="role">The associated role.</param>
|
||||||
/// <param name="claim">The associated claim.</param>
|
/// <param name="claim">The associated claim.</param>
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The cancellation token assocated with the current HttpContext.RequestAborted or CancellationToken.None if unavailable.
|
/// The cancellation token associated with the current HttpContext.RequestAborted or CancellationToken.None if unavailable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override CancellationToken CancellationToken => _cancel;
|
protected override CancellationToken CancellationToken => _cancel;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The cancellation token assocated with the current HttpContext.RequestAborted or CancellationToken.None if unavailable.
|
/// The cancellation token associated with the current HttpContext.RequestAborted or CancellationToken.None if unavailable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override CancellationToken CancellationToken => _cancel;
|
protected override CancellationToken CancellationToken => _cancel;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
namespace Microsoft.AspNetCore.Identity
|
namespace Microsoft.AspNetCore.Identity
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents all the options you can use to configure the cookies middleware uesd by the identity system.
|
/// Represents all the options you can use to configure the cookies middleware used by the identity system.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class IdentityConstants
|
public class IdentityConstants
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Identity
|
||||||
/// <param name="claimsFactory">The factory to use to create claims principals for a user.</param>
|
/// <param name="claimsFactory">The factory to use to create claims principals for a user.</param>
|
||||||
/// <param name="optionsAccessor">The accessor used to access the <see cref="IdentityOptions"/>.</param>
|
/// <param name="optionsAccessor">The accessor used to access the <see cref="IdentityOptions"/>.</param>
|
||||||
/// <param name="logger">The logger used to log messages, warnings and errors.</param>
|
/// <param name="logger">The logger used to log messages, warnings and errors.</param>
|
||||||
/// <param name="schemes">The logger used to log messages, warnings and errors.</param>
|
/// <param name="schemes">The scheme provider that is used enumerate the authentication schemes.</param>
|
||||||
public SignInManager(UserManager<TUser> userManager,
|
public SignInManager(UserManager<TUser> userManager,
|
||||||
IHttpContextAccessor contextAccessor,
|
IHttpContextAccessor contextAccessor,
|
||||||
IUserClaimsPrincipalFactory<TUser> claimsFactory,
|
IUserClaimsPrincipalFactory<TUser> claimsFactory,
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Identity.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
var rsaSecurityKey = credentials.Key as RsaSecurityKey;
|
var rsaSecurityKey = credentials.Key as RsaSecurityKey;
|
||||||
// Check that the key has either an Asymetric Algorithm assigned or that at least
|
// Check that the key has either an Asymmetric Algorithm assigned or that at least
|
||||||
// one of the RSA parameters are initialized to consider the key "valid".
|
// one of the RSA parameters are initialized to consider the key "valid".
|
||||||
if (rsaSecurityKey != null &&
|
if (rsaSecurityKey != null &&
|
||||||
(rsaSecurityKey.Rsa != null || rsaSecurityKey.Parameters.Modulus != null))
|
(rsaSecurityKey.Rsa != null || rsaSecurityKey.Parameters.Modulus != null))
|
||||||
|
|
|
||||||
|
|
@ -971,7 +971,7 @@ namespace Microsoft.AspNetCore.Identity.Test
|
||||||
IdentityResultAssert.IsSuccess(await manager.AddLoginAsync(user, login));
|
IdentityResultAssert.IsSuccess(await manager.AddLoginAsync(user, login));
|
||||||
var result = await manager.AddLoginAsync(user, login);
|
var result = await manager.AddLoginAsync(user, login);
|
||||||
IdentityResultAssert.IsFailure(result, _errorDescriber.LoginAlreadyAssociated());
|
IdentityResultAssert.IsFailure(result, _errorDescriber.LoginAlreadyAssociated());
|
||||||
IdentityResultAssert.VerifyLogMessage(manager.Logger, $"AddLogin for user {await manager.GetUserIdAsync(user)} failed because it was already assocated with another user.");
|
IdentityResultAssert.VerifyLogMessage(manager.Logger, $"AddLogin for user {await manager.GetUserIdAsync(user)} failed because it was already associated with another user.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Email tests
|
// Email tests
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue