public AuthenticationAccount ChangePassword(AuthenticationAccount account, string newPassword) { var passwordToken = securityManager.CreatePasswordToken(newPassword); account.ServiceToken = JsonConvert.SerializeObject(passwordToken); return(account); }
public override async ValueTask <AuthenticationResult> AcquireTokenSilentAsync( string[] scopes, AuthenticationAccount account, string tenantId, string replyUri, bool async, CancellationToken cancellationToken) { return(await SilentFactory(scopes, tenantId, replyUri, account)); }
public Invite CreateRestorePassword(AuthenticationAccount account, ConfirmationType type) => new Invite { Id = Guid.NewGuid(), Type = type, Email = account.ServiceId, ConfirmationCode = dataGenerator.GenerateSequence(FieldsLength.ConfirmationCode), IsUsed = false, AccountId = account.Id, PasswordRestore = true, };
private async Task ActivateAccount(Invite invite, AuthenticationAccount account) { account.IsActive = true; await authenticationAccountRepo.UpdateAsync(account); invite.IsUsed = true; await invitesRepo.UpdateAsync(invite); var user = await userRepo.GetByIdAsync(account.UserId); await userCookieManager.SetLoginCookie(Response, user); }