Skip to content

Commit e2599e0

Browse files
committed
fix: #687
1 parent 4bf8901 commit e2599e0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# angular-oauth2-oidc
22

3-
Support for OAuth 2 and OpenId Connect (OIDC) in Angular.
3+
Support for OAuth 2 and OpenId Connect (OIDC) in Angular. Already prepared for the upcoming OAuth 2.1.
44

55
![OIDC Certified Logo](https://raw.githubusercontent.com/manfredsteyer/angular-oauth2-oidc/master/oidc.png)
66

@@ -43,7 +43,7 @@ Please note, that this dependency is not needed for the **code flow**, which is
4343

4444
Successfully tested with **Angular 9** and its Router, PathLocationStrategy as well as HashLocationStrategy and CommonJS-Bundling via webpack. At server side we've used IdentityServer (.NET / .NET Core) and Redhat's Keycloak (Java).
4545

46-
**Angular 9**: Use 9.x versions of this library.
46+
**Angular 9**: Use 9.x versions of this library (should also work with older Angular versions!).
4747

4848
**Angular 8**: Use 8.x versions of this library.
4949

@@ -84,6 +84,7 @@ Successfully tested with **Angular 9** and its Router, PathLocationStrategy as w
8484
- Validating claims of the id_token regarding the specs
8585
- Hook for further custom validations
8686
- Single-Sign-Out by redirecting to the auth-server's logout-endpoint
87+
- Tested with all modern browsers and IE
8788

8889
## Sample-Auth-Server
8990

projects/lib/src/oauth-service.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
12251225
}
12261226
}
12271227

1228-
protected checkSession(): void {
1228+
public checkSession(): void {
12291229
const iframe: any = document.getElementById(this.sessionCheckIFrameName);
12301230

12311231
if (!iframe) {
@@ -1440,9 +1440,12 @@ export class OAuthService extends AuthConfig implements OnDestroy {
14401440
customParameters?: Map<string, string>
14411441
): void {
14421442
this._storage.setItem('access_token', accessToken);
1443-
if (grantedScopes) {
1443+
if (grantedScopes && !Array.isArray(grantedScopes)) {
14441444
this._storage.setItem('granted_scopes', JSON.stringify(grantedScopes.split('+')));
1445+
} else if (grantedScopes && Array.isArray(grantedScopes)) {
1446+
this._storage.setItem('granted_scopes', JSON.stringify(grantedScopes));
14451447
}
1448+
14461449
this._storage.setItem('access_token_stored_at', '' + Date.now());
14471450
if (expiresIn) {
14481451
const expiresInMilliSeconds = expiresIn * 1000;

0 commit comments

Comments
 (0)