public virtual async Task <ActionResult> SwitchToLinkedAccountSignIn(string tokenId) { var result = await _userLinkManager.GetSwitchedUserAndIdentity(tokenId); await _signInManager.SignInAsync(result.Identity, false); return(RedirectToAppHome()); }
public async Task<SwitchedAccountAuthenticateResultModel> LinkedAccountAuthenticate(string switchAccountToken) { var result = await _userLinkManager.GetSwitchedUserAndIdentity(switchAccountToken); var accessToken = CreateAccessToken(CreateJwtClaims(result.Identity)); return new SwitchedAccountAuthenticateResultModel { AccessToken = accessToken, EncryptedAccessToken = GetEncrpyedAccessToken(accessToken), ExpireInSeconds = (int)_configuration.Expiration.TotalSeconds }; }
public async Task <SwitchedAccountAuthenticateResultModel> LinkedAccountAuthenticate(string switchAccountToken) { var result = await _userLinkManager.GetSwitchedUserAndIdentity(switchAccountToken); //var accessToken = CreateAccessToken(CreateJwtClaims(result.Identity)); var identityServerToken = await _identityServerTokenGeneratorFacade.GetIdentityServerTokenForUserAsync(result.User); return(new SwitchedAccountAuthenticateResultModel { AccessToken = identityServerToken.AccessToken, EncryptedAccessToken = GetEncrpyedAccessToken(identityServerToken.AccessToken), RefreshToken = identityServerToken.RefreshToken, ExpireInSeconds = identityServerToken.Token.Lifetime }); }