Logout

Based on OpenID Connect Session Management 1.0 - draft 17.

The OP must have the endpoint end_session_endpoint. It's recommended to give the id_token in the request. If not set, the library tries to find it in its session.

The redirect_uri can be used by the OP to redirect the user to the page defined. The redirect_uri has to be registred in the OP configuration.

Basic :

$client = new Svgta\OidcClient\init(
  'https://id.provider.com/.well-known/openid-configuration'
);

$id_token = 'The_Id_Token_You_Get'; //format jwt string
$redirect_uri = 'https://yourApp.tld/logoutCallback';

$client->logout($id_token, $redirect_uri);
// $id_token and $redirecti_uri are optionals. If id_token is not given, the library try to find it in the session.
// if you don't give id_token but give redirect_uri : $client->logout(null, $redirect_uri);

Last updated