Exemple #1
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;

                var (frontChannel, backChannel) = await GetClientEndSessionUrlsAsync(endSessionMessage.Data);
                result.FrontChannelLogoutUrls = frontChannel;
                result.BackChannelLogouts = backChannel;
            }

            return result;
        }
Exemple #2
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);
        }
        public async Task <EndSessionCallbackValidationResult> ValidateCallbackAsync(NameValueCollection parameters)
        {
            var result = new EndSessionCallbackValidationResult()
            {
                IsError = true
            };

            result.LogoutId = parameters[_options.UserInteractionOptions.LogoutIdParameter];

            var sid = ValidateSid(parameters);

            if (sid == null)
            {
                result.Error = "Invalid session id";
            }
            else
            {
                result.IsError          = false;
                result.ClientLogoutUrls = await GetClientEndSessionUrlsAsync(sid);
            }

            return(result);
        }
Exemple #4
0
        public async Task <EndSessionCallbackValidationResult> ValidateCallbackAsync(NameValueCollection parameters)
        {
            var result = new EndSessionCallbackValidationResult()
            {
                IsError = true
            };

            result.LogoutId  = parameters[_options.UserInteractionOptions.LogoutIdParameter];
            result.SessionId = parameters[OidcConstants.EndSessionRequest.Sid];

            if (result.SessionId == null && result.LogoutId == null)
            {
                return(result);
            }

            result.IsError = false;

            if (result.SessionId.IsPresent())
            {
                result.ClientLogoutUrls = await GetClientEndSessionUrlsAsync(result.SessionId);
            }

            return(result);
        }