Logout
Login.gov supports RP-Initiated Logout, allowing clients to log users out of their current Login.gov session and redirect them back to the Relying Party.
Login.gov does not support Single Logout (SLO). The logout action will terminate the user’s session at Login.gov but will not end any other potentially active sessions within service provider applications. For example, if a user signs in to applications A and B through Login.gov, a logout request from A will end their Login.gov session, but will not affect the session in application B.
User experience impact:
As per the OIDC spec, Login.gov will display a Logout confirmation screen to users on logout. Users will need to click a button to complete the logout process. This protects against forged logout request attacks.
If the user does not click the button, they will not be redirected back to your application.
Logout request
To log out a user, send them to the /openid_connect/logout
endpoint with the following parameters:
client_id
post_logout_redirect_uri
state (optional)
state
added to the redirect back to the post_logout_redirect_uri
.
Logout response
In a successful logout, i.e. the request is valid and the user confirms that they want to log out, Login.gov will redirect the user to the provided post_logout_redirect_uri
with the state
parameter added to the URL. If the request is invalid, the user will be shown an error page. If the user declines to click the button on the confirmation page, they will not be redirected to the post_logout_redirect_uri
and there will be no response to your application.
https://idp.int.identitysandbox.gov/openid_connect/logout?
client_id=${CLIENT_ID}&
post_logout_redirect_uri=${REDIRECT_URI}&
state=abcdefghijklmnopabcdefghijklmnop
https://agency.gov/response?
state=abcdefghijklmnopabcdefghijklmnop