public virtual async Task <ImpersonateOutput> Impersonate(ImpersonateInput input)
 {
     return(new ImpersonateOutput
     {
         ImpersonationToken = await _impersonationManager.GetImpersonationToken(input.UserId, input.TenantId),
         TenancyName = await GetTenancyNameOrNullAsync(input.TenantId)
     });
 }
Exemplo n.º 2
0
 public virtual async Task <ImpersonateOutput> Impersonate(ImpersonateInput input)
 {
     return(new ImpersonateOutput
     {
         ImpersonationToken = "",
         TenancyName = await GetTenancyNameOrNullAsync(input.TenantId)
     });
 }
Exemplo n.º 3
0
        public virtual async Task <JsonResult> Impersonate([FromBody] ImpersonateInput input)
        {
            var output = await _accountAppService.Impersonate(input);

            await _signInManager.SignOutAsync();

            return(Json(new AjaxResponse
            {
                TargetUrl = _webUrlService.GetSiteRootAddress(output.TenancyName) + "Account/ImpersonateSignIn?tokenId=" + output.ImpersonationToken
            }));
        }
Exemplo n.º 4
0
 public async Task <ImpersonateOutput> Impersonate(ImpersonateInput input)
 {
     return(await ApiClient.PostAsync <ImpersonateOutput>(GetEndpoint(nameof(Impersonate)), input));
 }