コード例 #1
0
        public async Task SignInUserPartiallyAsync(
            Guid userId,
            MfaProvider setupMfaProviders,
            string returnUrl = null)
        {
            var claims = new List <Claim>
            {
                new Claim(ClaimTypes.Anonymous, JsonConvert.SerializeObject(new AuthenticationProfile(userId, setupMfaProviders))),
            };

            if (!string.IsNullOrWhiteSpace(returnUrl))
            {
                claims.Add(new Claim(ClaimTypes.UserData, returnUrl));
            }

            await this._httpContextAccessor.HttpContext.SignInAsync(
                "login-partial",
                new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme)));
        }
コード例 #2
0
 public UnauthenticatedUser(Guid userId, MfaProvider setupMfaProviders)
 {
     this.UserId            = userId;
     this.SetupMfaProviders = setupMfaProviders;
 }
コード例 #3
0
 public AuthenticateUserCommandResult(Guid userId, MfaProvider mfaProviders, AssertionOptions assertionOptions)
     : base(userId, AuthenticationState.AwaitingMfaDeviceCode)
 {
     this.SetupMfaProviders = mfaProviders;
     this._assertionOptions = assertionOptions;
 }
コード例 #4
0
 public AuthenticationProfile(Guid userId, MfaProvider setupMfaProviders)
 {
     this.UserId            = userId;
     this.SetupMfaProviders = setupMfaProviders;
 }
コード例 #5
0
 public AuthenticateUserCommandResult(Guid userId, AuthenticationState authenticationStatus, MfaProvider mfaProviders)
     : base(userId, authenticationStatus)
 {
     this.SetupMfaProviders = mfaProviders;
 }