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

            _result = result;
        }
Exemplo n.º 4
0
 internal EndSessionCallbackResult(
     EndSessionCallbackValidationResult result,
     IdentityServerOptions options,
     BackChannelLogoutClient backChannelClient)
     : this(result)
 {
     _options           = options;
     _backChannelClient = backChannelClient;
 }
Exemplo n.º 5
0
 internal EndSessionCallbackResult(
     EndSessionCallbackValidationResult result,
     IClientSessionService clientList,
     IMessageStore <LogoutMessage> logoutMessageStore,
     IdentityServerOptions options)
     : this(result)
 {
     _clientList         = clientList;
     _logoutMessageStore = logoutMessageStore;
     _options            = options;
 }
Exemplo 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");
         }
     }
 }
Exemplo 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);
    }