Esempio n. 1
0
 internal EndSessionCallbackResult(
     EndSessionCallbackValidationResult result,
     IdentityServerOptions options)
     : this(result)
 {
     _options = options;
 }
Esempio n. 2
0
 public EndSessionCallbackResultTests()
 {
     _validationResult = new EndSessionCallbackValidationResult()
     {
         IsError = false,
     };
     _options = new IdentityServerOptions();
     _subject = new EndSessionCallbackResult(_validationResult, _options);
 }
Esempio n. 3
0
        public EndSessionCallbackResult(EndSessionCallbackValidationResult result)
        {
            if (result == null)
            {
                throw new ArgumentNullException(nameof(result));
            }

            _result = result;
        }
Esempio n. 4
0
 internal EndSessionCallbackResult(
     EndSessionCallbackValidationResult result,
     IdentityServerOptions options,
     BackChannelLogoutClient backChannelClient)
     : this(result)
 {
     _options           = options;
     _backChannelClient = backChannelClient;
 }
Esempio n. 5
0
 internal EndSessionCallbackResult(
     EndSessionCallbackValidationResult result,
     IClientSessionService clientList,
     IMessageStore <LogoutMessage> logoutMessageStore,
     IdentityServerOptions options)
     : this(result)
 {
     _clientList         = clientList;
     _logoutMessageStore = logoutMessageStore;
     _options            = options;
 }
Esempio n. 6
0
 private async Task InvokeBackChannelClientsAsync(EndSessionCallbackValidationResult result)
 {
     if (result.BackChannelLogouts?.Any() == true)
     {
         // best-effort, and async to not block the response to the browser
         try
         {
             await _backChannelClient.SendLogoutsAsync(result.BackChannelLogouts);
         }
         catch (Exception ex)
         {
             _logger.LogError(ex, "Error calling backchannel sign-out urls");
         }
     }
 }
Esempio n. 7
0
    /// <inheritdoc />
    public async Task <EndSessionCallbackValidationResult> ValidateCallbackAsync(NameValueCollection parameters)
    {
        var result = new EndSessionCallbackValidationResult
        {
            IsError = true
        };

        var endSessionId      = parameters[Constants.UIConstants.DefaultRoutePathParams.EndSessionCallback];
        var endSessionMessage = await EndSessionMessageStore.ReadAsync(endSessionId);

        if (endSessionMessage?.Data?.ClientIds?.Any() == true)
        {
            result.IsError = false;
            result.FrontChannelLogoutUrls = await LogoutNotificationService.GetFrontChannelLogoutNotificationsUrlsAsync(endSessionMessage.Data);
        }
        else
        {
            result.Error = "Failed to read end session callback message";
        }

        return(result);
    }