-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): Auth module now support CodeFlow/HybridFlow with PKCE
- Loading branch information
Showing
25 changed files
with
156 additions
and
86 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import sharedEnvironment from './base'; | ||
import { IEnvironment } from '@env/ienvironment'; | ||
|
||
export const environment = { | ||
export const environment: IEnvironment = { | ||
...sharedEnvironment, | ||
production: true, | ||
envName: 'mock', | ||
|
||
DOCS_BASE_URL: 'http://localhost:8000', | ||
API_BASE_URL: 'http://localhost:3000/api', | ||
WS_EVENT_BUS_URL: 'ws://localhost:3000/eventbus', | ||
|
||
auth: { | ||
clientId: 'ngxapp', | ||
// issuer: 'http://localhost:8080/auth/realms/ngx', | ||
issuer: 'https://keycloak-ngx.1d35.starter-us-east-1.openshiftapps.com/auth/realms/ngx', | ||
clientId: 'ngxapp', | ||
}, | ||
}; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import sharedEnvironment from './base'; | ||
import { IEnvironment } from '@env/ienvironment'; | ||
|
||
export const environment = { | ||
export const environment: IEnvironment = { | ||
...sharedEnvironment, | ||
production: true, | ||
envName: 'prod', | ||
|
||
DOCS_BASE_URL: 'http://localhost:8000', | ||
API_BASE_URL: 'http://localhost:3000/api', | ||
WS_EVENT_BUS_URL: 'ws://localhost:3000/eventbus', | ||
|
||
auth: { | ||
clientId: 'ngxapp', | ||
// issuer: 'http://localhost:8080/auth/realms/ngx', | ||
issuer: 'https://keycloak-ngx.1d35.starter-us-east-1.openshiftapps.com/auth/realms/ngx', | ||
clientId: 'ngxapp', | ||
}, | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { OidcProviderConfig } from '@ngx-starter-kit/oidc'; | ||
|
||
export type LogLevel = 'debug' | 'info' | 'warn' | 'error'; | ||
|
||
export interface IEnvironment { | ||
production: boolean; | ||
envName: string; | ||
|
||
// Enables use of ng.profiler.timeChangeDetection(); in browser console | ||
enableDebugTools?: boolean; | ||
logLevel?: LogLevel; | ||
auth?: OidcProviderConfig; | ||
[key: string]: any; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
import { Actions, ofActionErrored, ofActionSuccessful } from '@ngxs/store'; | ||
import { Injectable } from '@angular/core'; | ||
import { Login, LoginSuccess } from './auth.actions'; | ||
import { GoogleAnalyticsService } from '@ngx-starter-kit/core/src/lib/services/google-analytics.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class AuthHandler { | ||
constructor(private actions$: Actions, private analytics: GoogleAnalyticsService) { | ||
constructor(private actions$: Actions) { | ||
this.actions$.pipe(ofActionSuccessful(Login)).subscribe(action => console.log('Login........Action Successful')); | ||
this.actions$.pipe(ofActionErrored(Login)).subscribe(action => console.log('Login........Action Errored')); | ||
this.actions$.pipe(ofActionSuccessful(LoginSuccess)).subscribe((action: LoginSuccess) => { | ||
this.analytics.setUsername(action.payload.preferred_username); | ||
}); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.