From 5775590a08f0f1699d9ed7129bcad7fddee59f68 Mon Sep 17 00:00:00 2001 From: damienbod Date: Fri, 5 May 2023 19:15:33 +0200 Subject: [PATCH 1/5] fix id_token expired check --- .../src/lib/callback/periodically-token-check.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts b/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts index c6dbd051f..7de0d2288 100644 --- a/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts +++ b/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts @@ -169,6 +169,9 @@ export class PeriodicallyTokenCheckService { return false; } - return this.authStateService.hasAccessTokenExpiredIfExpiryExists(config); + let idTokenExpired = this.authStateService.hasIdTokenExpiredAndRenewCheckIsEnabled(config); + let accessTokenExpired = this.authStateService.hasAccessTokenExpiredIfExpiryExists(config); + + return idTokenExpired || accessTokenExpired; } } From 4b18fd796ff5b0c7ed359ddef74098199e83fd29 Mon Sep 17 00:00:00 2001 From: damienbod Date: Fri, 5 May 2023 19:16:40 +0200 Subject: [PATCH 2/5] const instead of let --- .../src/lib/callback/periodically-token-check.service.ts | 4 ++-- .../src/app/auth-config.module.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts b/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts index 7de0d2288..5ddc2908c 100644 --- a/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts +++ b/projects/angular-auth-oidc-client/src/lib/callback/periodically-token-check.service.ts @@ -169,8 +169,8 @@ export class PeriodicallyTokenCheckService { return false; } - let idTokenExpired = this.authStateService.hasIdTokenExpiredAndRenewCheckIsEnabled(config); - let accessTokenExpired = this.authStateService.hasAccessTokenExpiredIfExpiryExists(config); + const idTokenExpired = this.authStateService.hasIdTokenExpiredAndRenewCheckIsEnabled(config); + const accessTokenExpired = this.authStateService.hasAccessTokenExpiredIfExpiryExists(config); return idTokenExpired || accessTokenExpired; } diff --git a/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts b/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts index b865ca9ba..c555dec2e 100644 --- a/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts +++ b/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts @@ -13,6 +13,7 @@ import { AuthModule, LogLevel } from 'angular-auth-oidc-client'; responseType: 'code', silentRenew: true, useRefreshToken: true, + disableIdTokenValidation: false, // triggerRefreshWhenIdTokenExpired: false, logLevel: LogLevel.Debug, }, From 15f4f946c56744d6122d1b9996df40635ee951de Mon Sep 17 00:00:00 2001 From: damienbod Date: Fri, 5 May 2023 19:19:18 +0200 Subject: [PATCH 3/5] default id_token check is not used --- .../src/app/auth-config.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts b/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts index c555dec2e..a6dc163b6 100644 --- a/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts +++ b/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts @@ -13,7 +13,7 @@ import { AuthModule, LogLevel } from 'angular-auth-oidc-client'; responseType: 'code', silentRenew: true, useRefreshToken: true, - disableIdTokenValidation: false, + // disableIdTokenValidation: false, // triggerRefreshWhenIdTokenExpired: false, logLevel: LogLevel.Debug, }, From de129486644c2ae4a85d69cab111d88bd75a0191 Mon Sep 17 00:00:00 2001 From: damienbod Date: Fri, 5 May 2023 19:38:46 +0200 Subject: [PATCH 4/5] reset test client --- .../src/app/auth-config.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts b/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts index a6dc163b6..b865ca9ba 100644 --- a/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts +++ b/projects/sample-code-flow-refresh-tokens/src/app/auth-config.module.ts @@ -13,7 +13,6 @@ import { AuthModule, LogLevel } from 'angular-auth-oidc-client'; responseType: 'code', silentRenew: true, useRefreshToken: true, - // disableIdTokenValidation: false, // triggerRefreshWhenIdTokenExpired: false, logLevel: LogLevel.Debug, }, From bf1cc7f275f3349e0f6b0c9ede5f93b639a2e4dc Mon Sep 17 00:00:00 2001 From: damienbod Date: Fri, 5 May 2023 19:42:43 +0200 Subject: [PATCH 5/5] release 15.0.5 --- CHANGELOG.md | 5 +++++ package-lock.json | 2 +- package.json | 2 +- projects/angular-auth-oidc-client/package.json | 2 +- projects/schematics/package.json | 2 +- projects/schematics/src/ng-add/actions/add-dependencies.ts | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 501119073..4733f2708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Angular Lib for OpenID Connect/OAuth2 Changelog +### 2023-05-05 15.0.5 + +- Bugfix id token expire check + - [PR](https://github.com/damienbod/angular-auth-oidc-client/pull/1751) + ### 2023-04-15 15.0.4 - isCurrentlyInPopup will check for opener and session storage diff --git a/package-lock.json b/package-lock.json index 7ca871357..9f8d0d265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "angular-auth-oidc-client", - "version": "15.0.4", + "version": "15.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e71c94376..86c42f8a5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/damienbod/angular-auth-oidc-client/issues" }, - "version": "15.0.4", + "version": "15.0.5", "scripts": { "ng": "ng", "build": "npm run build-lib", diff --git a/projects/angular-auth-oidc-client/package.json b/projects/angular-auth-oidc-client/package.json index d0f749fa4..606e036b9 100644 --- a/projects/angular-auth-oidc-client/package.json +++ b/projects/angular-auth-oidc-client/package.json @@ -36,7 +36,7 @@ "authorization" ], "license": "MIT", - "version": "15.0.4", + "version": "15.0.5", "description": "Angular Lib for OpenID Connect & OAuth2", "schematics": "./schematics/collection.json", "ng-add": { diff --git a/projects/schematics/package.json b/projects/schematics/package.json index 0e21bdfa2..372425f2c 100644 --- a/projects/schematics/package.json +++ b/projects/schematics/package.json @@ -1,6 +1,6 @@ { "name": "schematics", - "version": "15.0.4", + "version": "15.0.5", "description": "A schematic for the Angular Lib for OpenID Connect & OAuth2", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/projects/schematics/src/ng-add/actions/add-dependencies.ts b/projects/schematics/src/ng-add/actions/add-dependencies.ts index 1fb82421d..f9abadf7c 100644 --- a/projects/schematics/src/ng-add/actions/add-dependencies.ts +++ b/projects/schematics/src/ng-add/actions/add-dependencies.ts @@ -5,7 +5,7 @@ import { NgAddOptions } from '../models/ng-add-options'; const dependenciesToAdd: any[] = [ { name: 'angular-auth-oidc-client', - version: '15.0.4', + version: '15.0.5', }, ];