Steven
Steven

Reputation: 43

IdentityServer4 - End Session in POST

IdentityServer4 documentation explains how to use the end session endpoint using the HTTP method GET (https://identityserver4.readthedocs.io/en/latest/endpoints/endsession.html).

Is it possible to configure it in order to accept POST requests as well?

Upvotes: 0

Views: 150

Answers (1)

Tore Nestenius
Tore Nestenius

Reputation: 19971

If you look at the source code here, it seems that the endpoint accepts both GET and POST requests.

        if (HttpMethods.IsGet(context.Request.Method))
        {
            parameters = context.Request.Query.AsNameValueCollection();
        }
        else if (HttpMethods.IsPost(context.Request.Method))
        {
            parameters = (await context.Request.ReadFormAsync()).AsNameValueCollection();
        }
        else
        {
            _logger.LogWarning("Invalid HTTP method for end session endpoint.");
            return new StatusCodeResult(HttpStatusCode.MethodNotAllowed);
        }

Upvotes: 1

Related Questions