Starting from version 2.1, you can detect when a user signs out from the Identity Provider (IdP) using the OpenID Connect Session Management 1.0 specification.
When sessionChecksEnabled is set to true:
- The library automatically ends your local session by calling
logOut (deleting current tokens). - The library emits a
session_terminated event.
Note: This feature requires that your Identity Provider supports OpenID Connect Session Management.
import { AuthConfig } from 'angular-oauth2-oidc';
export const authConfig: AuthConfig = {
issuer: 'https://steyer-identity-server.azurewebsites.net/identity',
redirectUri: window.location.origin + '/index.html',
silentRefreshRedirectUri: window.location.origin + '/silent-refresh.html',
clientId: 'spa-demo',
scope: 'openid profile email voucher',
// Activate Session Checks:
sessionChecksEnabled: true,
}