PHP OIDC Client
  • PHP Oidc-Client
    • Introduction
    • Requirements
    • Supported functionnality
    • How to install
  • How to use the library
    • Generic use of the library
    • Microsoft Azure OIDC
    • Google
    • Github
    • Dropbox
  • Deal with the provider
    • Authorization flow
    • Token endpoint
    • Tokens managment
    • UserInfo
    • Logout
  • Advanced Topic
    • Secure the session
    • Request options
    • Nested JWT
    • UserInfo response encrypted (JWE)
  • Utils
    • LogLevel
    • Generate a key pair
    • Generate an UUID
    • Generate a security key
    • Get informations of a certificate
    • Verify if json
  • Links / Credits
    • Repo
    • OIDC specs
    • JWT Framework
    • Guzzle
Powered by GitBook
On this page
  1. Deal with the provider

Logout

PreviousUserInfoNextSecure the session

Last updated 1 year ago

Based on OpenID Connect Session Management 1.0 - .

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);
draft 17