Skip to content

Commit

Permalink
Added useCustomAuth0Domain flag
Browse files Browse the repository at this point in the history
openid-configuration now contains an optional flag to allow
 custom domains in auth0 to function as normal.
 A small change in the url service checks if the authority ends
 with auth0.com OR the useCustomAuth0Domain is set.
  • Loading branch information
fredhair committed Aug 16, 2023
1 parent 8f4553a commit 440b1da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 440b1da

Please sign in to comment.