Exemple #1
0
        public override async Task ValidateLogoutRequest([NotNull] ValidateLogoutRequestContext context)
        {
            // If an optional post_logout_redirect_uri was provided, validate it.
            if (!string.IsNullOrEmpty(context.PostLogoutRedirectUri))
            {
                var application = await Applications.FindByLogoutRedirectUri(context.PostLogoutRedirectUri, context.HttpContext.RequestAborted);

                if (application == null)
                {
                    Logger.LogError("The logout request was rejected because the client application corresponding " +
                                    "to the specified post_logout_redirect_uri was not found in the database: " +
                                    "'{PostLogoutRedirectUri}'.", context.PostLogoutRedirectUri);

                    context.Reject(
                        error: OpenIdConnectConstants.Errors.InvalidClient,
                        description: "Invalid post_logout_redirect_uri.");

                    return;
                }
            }

            context.Validate();
        }