frontend

Create a Logout URL for Browsers

Changed on

This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user.

This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the /self-service/logout/api URL directly with the Ory Session Token.

The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error.

When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.

get/self-service/logout/browser

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /self-service/logout/browser
  • Auth
    none declared

Query parameters

return_tostring

Return to URL

The URL to which the browser should be redirected to after the logout has been performed.

Headers

cookiestring

HTTP Cookies

If you call this endpoint from a backend, please include the original Cookie header in the request.

Response

logoutFlow

logout_tokenstring required

LogoutToken can be used to perform logout using AJAX.

logout_urlstring required

LogoutURL can be opened in a browser to sign the user out.

format: uri

Example response

{
  "logout_url": "logout_url",
  "logout_token": "logout_token"
}

Changes

    • info

      added the new optional query request parameter return_to

    • info

      added the non-success response with the status

    • info

      api operation id createSelfServiceLogoutFlowUrlForBrowsers removed and replaced with createBrowserLogoutFlow

    • info

      api tag frontend added

    • info

      api tag v0alpha2 removed