Skip to content

/logout

Request

Use this operation to sign a user out by removing their Okta browser session. This is the recommended method over GET as you can wrap the parameters in the request body.

This endpoint takes an ID token and signs the user out of Okta if the subject matches the current Okta session. Specify a post_logout_redirect_uri to redirect the browser after the user signs out. Otherwise, the browser is redirected to the Okta sign-in page. See Sign users out.

If no Okta session exists, this endpoint has no effect and the browser is redirected immediately to the Okta sign-in page or the post_logout_redirect_uri (if specified).

If the ID token passed with the id_token_hint parameter is invalid, the browser is redirected to an error page.

If the ID token is valid, but expired, and the subject matches the current Okta session, a logout request signs the user out and redirects the browser to the post_logout_redirect_uri.

Note: When making requests to the /logout endpoint, the browser (user agent) should be redirected to the endpoint. You need to make a POST request from a form. A POST request to this endpoint from the backend doesn't completely terminate the session.

Bodyapplication/x-www-form-urlencoded
id_token_hintstringrequired

A valid ID token with a subject that matches the current session

post_logout_redirect_uristring

Location to redirect to after the logout is performed. It must match the value preregistered in Okta during client registration.

statestring

An optional value that's returned as a query parameter during the redirect at the end of the flow

POST
/oauth2/v1/logout
curl -i -X POST \
  https://okta-subdomain.pixtulate.com/oauth2/v1/logout \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'id_token_hint=<id_token_hint_value>' \
  -d post_logout_redirect_uri=https://www.example.com/oauth2/postLogoutRedirectUri \
  -d state=1230000

Responses

Successful Logout

Response
No content