Add logout with OIDC to application


# Add logout with OIDC to application

OpenID Connect provides OpenID Connect RP-Initiated Logout (opens new window) to terminate user sessions. The logout endpoint is used to terminate the user session at Asgardeo and to log the user out. When a user is successfully logged out, the user is redirected to the post_logout_redirect_uri sent in the logout request.

Logout endpoint

https://api.asgardeo.io/t/<organization_name>/oidc/logout
1

Sample URL

https://api.asgardeo.io/t/bifrost/oidc/logout?id_token_hint=<id_token>&post_logout_redirect_uri=<redirect URI>&state=<state>
1

The logout request has the following parameters:


Request Parameter Description
id_token_hintRecommended The ID token returned by Asgardeo (in response to the token request) is passed to the logout endpoint with a hint about the user's current authenticated session on the application.
post_logout_redirect_uriOptional The URL to be redirected to during user logout. The value defined here should be added as one of the authorized redirect URLs. This should be passed along with the id_token_hint. If the post_logout_redirect_uri parameter is not passed, the user will be routed to Asgardeo's common page after logout.
stateOptional The parameter passed from the application to Asgardeo to maintain state information. If an application sends this parameter, Asgardeo will return this information in the response.

Sample response

http://myapp.com?state=state-param
1