Skip to content

Commit 3d98892

Browse files
committed
moved jsrsign into separate lib
1 parent 748fdb8 commit 3d98892

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

projects/lib/src/token-validation/jwks-validation-handler.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
AbstractValidationHandler,
3-
ValidationParams
4-
} from './validation-handler';
1+
import { NullValidationHandler } from './null-validation-handler';
52

63
const err = `PLEASE READ THIS CAREFULLY:
74
@@ -25,19 +22,11 @@ This also results in smaller bundle sizes.
2522
* telling the users that the real one has been moved
2623
* to an library of its own, namely angular-oauth2-oidc-utils
2724
*/
28-
export class JwksValidationHandler extends AbstractValidationHandler {
25+
export class JwksValidationHandler extends NullValidationHandler {
2926

3027
constructor() {
3128
super();
3229
console.error(err);
3330
}
3431

35-
validateSignature(params: ValidationParams, retry = false): Promise<any> {
36-
throw new Error(err);
37-
}
38-
39-
calcHash(valueToHash: string, algorithm: string): Promise<string> {
40-
throw new Error(err);
41-
}
42-
4332
}

projects/quickstart-demo/src/app/app.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
22
import { OAuthService } from 'angular-oauth2-oidc';
33
import { authCodeFlowConfig } from 'projects/sample/src/app/auth-code-flow.config';
44
import { filter } from 'rxjs/operators';
5-
import { JwksValidationHandler } from 'angular-oauth2-oidc-jwks';
5+
import { JwksValidationHandler } from 'angular-oauth2-oidc';
66

77
@Component({
88
selector: 'app-root',
@@ -16,6 +16,8 @@ export class AppComponent {
1616
this.oauthService.configure(authCodeFlowConfig);
1717
this.oauthService.loadDiscoveryDocumentAndLogin();
1818

19+
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
20+
1921
// Automatically load user profile
2022
this.oauthService
2123
.events

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
"angular-oauth2-oidc": [
2626
"projects/lib/src/public_api"
2727
],
28-
28+
2929
"angular-oauth2-oidc-jwks": [
3030
"projects/angular-oauth2-oidc-jwks/src/public-api"
3131
]
32+
33+
3234
}
3335
}
3436
}

0 commit comments

Comments
 (0)