The Logout Endpoint is responsible for logging out the user and revoking tokens.
access_token
(required): The access token for the associated user.anti_csrf_token
(optional): An optional token for client-side CSRF protection.
client = SignInService::Client.new
access_token = "your_id_token_hint"
anti_csrf_token = "your_anti_csrf_token" # Optional
response = client.logout(access_token: access_token, anti_csrf_token: anti_csrf_token)
The logout
method returns a Faraday::Response object.
In the case of successful logout from login.gov you can expect an HTTP status code of 302. You will need to redirect to the location header and expect a callback
redirect_to response.headers['location'] if response.status == 302
In the case of id.me you will receive a 200 with an empty body