diff --git a/projects/angular-auth-oidc-client/src/lib/config/openid-configuration.ts b/projects/angular-auth-oidc-client/src/lib/config/openid-configuration.ts index 1b37eebc..b292635d 100644 --- a/projects/angular-auth-oidc-client/src/lib/config/openid-configuration.ts +++ b/projects/angular-auth-oidc-client/src/lib/config/openid-configuration.ts @@ -66,6 +66,12 @@ export interface OpenIdConfiguration { * By entering a value, you can renew the tokens before the tokens expire. */ renewTimeBeforeTokenExpiresInSeconds?: number; + /** + * Allows for a custom domain to be used with Auth0. + * With this flag set the 'authority' does not have to end with + * 'auth0.com' to trigger the auth0 special handling of logouts. + */ + useCustomAuth0Domain?: boolean; /** * When set to true, refresh tokens are used to renew the user session. * When set to false, standard silent renew is used. diff --git a/projects/angular-auth-oidc-client/src/lib/utils/url/url.service.ts b/projects/angular-auth-oidc-client/src/lib/utils/url/url.service.ts index b26cd2c6..c003c4e3 100644 --- a/projects/angular-auth-oidc-client/src/lib/utils/url/url.service.ts +++ b/projects/angular-auth-oidc-client/src/lib/utils/url/url.service.ts @@ -796,13 +796,13 @@ export class UrlService { } private isAuth0Endpoint(configuration: OpenIdConfiguration): boolean { - const { authority } = configuration; + const { authority, useCustomAuth0Domain } = configuration; if (!authority) { return false; } - return authority.endsWith(AUTH0_ENDPOINT); + return authority.endsWith(AUTH0_ENDPOINT) || useCustomAuth0Domain; } private composeAuth0Endpoint(configuration: OpenIdConfiguration): string {