Beispiel #1
0
        private async Task <IActionResult> RedirectToLogOutAsync(SignOutValidationResult validatedResult)
        {
            var logoutMessage = new LogoutMessage()
            {
                ClientId              = validatedResult.Client?.ClientId,
                ClientName            = validatedResult.Client?.ClientName,
                SubjectId             = validatedResult.User?.GetSubjectId(),
                ClientIds             = validatedResult.ClientIds,
                PostLogoutRedirectUri = validatedResult.ReplyUrl
            };

            string id = null;

            if (logoutMessage.ClientId != null && logoutMessage.ClientIds.Any())
            {
                var msg = new Message <LogoutMessage>(logoutMessage, _clock.UtcNow.UtcDateTime);
                id = await _logoutMessageStore.WriteAsync(msg);
            }

            var redirectUrl = _options.UserInteraction.LogoutUrl;

            if (redirectUrl.IsLocalUrl())
            {
                redirectUrl = HttpContext.GetIdentityServerRelativeUrl(redirectUrl);
            }

            if (id != null)
            {
                redirectUrl = redirectUrl.AddQueryString(_options.UserInteraction.LogoutIdParameter, id);
            }

            return(Redirect(redirectUrl));
        }
Beispiel #2
0
 public SignOutValidationLog(SignOutValidationResult result)
 {
     if (result.RelyingParty != null)
     {
         Realm            = result.RelyingParty.Realm;
         RelyingPartyName = result.RelyingParty.Name;
         ReplyUrl         = result.RelyingParty.ReplyUrl;
     }
 }