Created
January 13, 2020 14:56
-
-
Save Ch3shireDev/ab0a100bcfa8e30eabf1ab351e6195fc to your computer and use it in GitHub Desktop.
Angular OAuth2 connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { APP_INITIALIZER, NgModule } from '@angular/core'; | |
| import { AuthConfig, OAuthModule } from 'angular-oauth2-oidc'; | |
| import { InitialAuthService } from './initial-auth.service'; | |
| const origin = 'http://localhost:4200'; | |
| const issuer = 'https://dev-09ixy5yn.auth0.com'; | |
| const clientId = 'FuDdsYDpESTGjE4BWcAE4l0F8Ebc8SjI'; | |
| // const issuer = 'https://philly-vanilly.auth0.com'; | |
| // const clientId = 'r4gL1ntxR2lnodnu81WFnWNOWdO5SFuV'; | |
| const configAuthZero: AuthConfig = { | |
| issuer: `${issuer}/`, | |
| customQueryParams: { audience: `${issuer}/api/v2/` }, | |
| redirectUri: `${origin}/`, | |
| silentRefreshRedirectUri: `${origin}/`, | |
| clientId, | |
| scope: 'openid profile email', | |
| clearHashAfterLogin: true, | |
| showDebugInformation: true, | |
| requireHttps: false, | |
| }; | |
| configAuthZero.logoutUrl = | |
| `${configAuthZero.issuer}v2/logout?client_id=${configAuthZero.clientId}&returnTo=${encodeURIComponent(configAuthZero.redirectUri)}`; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment