Skip to content

Commit 36b1ea2

Browse files
Switch to v9 version of code flow
1 parent 57a67f3 commit 36b1ea2

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository shows a basic Angular CLI application with [the `angular-oauth2-
66

77
This demonstrates:
88

9-
- Use of **the Implicit Flow**, see [#24 for Code Flow](https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-with-auth-guards/issues/24) support
9+
- Use of **the Code+PKCE Flow** (so no JWKS validation)
1010
- Modules (core, shared, and two feature modules)
1111
- An auth guard that forces you to login when navigating to protected routes
1212
- An auth guard that just prevents you from navigating to protected routes
@@ -18,6 +18,11 @@ This demonstrates:
1818

1919
Most interesting features can be found in [the core module](./src/app/core).
2020

21+
## Implicit Flow
22+
23+
If you need an example of the _Implicit Flow_ check out [the last commit with that flow](https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-with-auth-guards/commit/3c95d8891b4c086d5cd109d05cdd66171ef4b960) or even earlier versions.
24+
For new applications Code+PKCE flow is recommended for JavaScript clients, and this example repository now demonstrates this as the main use case.
25+
2126
## Usage
2227

2328
This repository has been scaffolded with the Angular 5 CLI, then later upgraded to newer versions of the Angular CLI.

package-lock.json

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@angular/platform-browser-dynamic": "^9.1.0",
1919
"@angular/router": "^9.1.0",
2020
"angular-oauth2-oidc": "^9.1.0",
21-
"angular-oauth2-oidc-jwks": "^9.0.0",
2221
"core-js": "^2.6.11",
2322
"rxjs": "^6.5.4",
2423
"tslib": "^1.11.1",

src/app/core/core.module.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { HttpClientModule } from '@angular/common/http';
22
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
3-
import { AuthConfig, OAuthModule, OAuthModuleConfig, OAuthStorage, ValidationHandler, } from 'angular-oauth2-oidc';
4-
import { JwksValidationHandler } from 'angular-oauth2-oidc-jwks';
3+
import { AuthConfig, NullValidationHandler, OAuthModule, OAuthModuleConfig, OAuthStorage, ValidationHandler, } from 'angular-oauth2-oidc';
54
import { authConfig } from './auth-config';
65
import { AuthGuardWithForcedLogin } from './auth-guard-with-forced-login.service';
76
import { AuthGuard } from './auth-guard.service';
@@ -31,7 +30,7 @@ export class CoreModule {
3130
providers: [
3231
{ provide: AuthConfig, useValue: authConfig },
3332
{ provide: OAuthModuleConfig, useValue: authModuleConfig },
34-
{ provide: ValidationHandler, useClass: JwksValidationHandler },
33+
{ provide: ValidationHandler, useClass: NullValidationHandler },
3534
{ provide: OAuthStorage, useFactory: storageFactory },
3635
]
3736
};

0 commit comments

Comments
 (0)