Skip to content

Commit 6743945

Browse files
committed
1 parent 79347ee commit 6743945

File tree

10 files changed

+98
-23
lines changed

10 files changed

+98
-23
lines changed

angular-oauth2-oidc/docs/classes/AuthConfig.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ <h3 id="inputs">
18051805
*/
18061806
public requestAccessToken? &#x3D; true;
18071807

1808-
public options?: any;
1808+
public options?: any &#x3D; null;
18091809

18101810
/**
18111811
* The issuer&#x27;s uri.
@@ -1825,13 +1825,13 @@ <h3 id="inputs">
18251825
/**
18261826
* Url of the token endpoint as defined by OpenId Connect and OAuth 2.
18271827
*/
1828-
public tokenEndpoint?: string;
1828+
public tokenEndpoint?: string &#x3D; null;
18291829

18301830
/**
18311831
* Url of the userinfo endpoint as defined by OpenId Connect.
18321832
*
18331833
*/
1834-
public userinfoEndpoint?: string;
1834+
public userinfoEndpoint?: string &#x3D; null;
18351835

18361836
public responseType? &#x3D; &#x27;token&#x27;;
18371837

@@ -1874,7 +1874,7 @@ <h3 id="inputs">
18741874
* it does not bring additional security and is therefore
18751875
* as good as using no password.
18761876
*/
1877-
public dummyClientSecret?: string;
1877+
public dummyClientSecret?: string &#x3D; null;;
18781878

18791879

18801880
/**
@@ -1896,13 +1896,13 @@ <h3 id="inputs">
18961896
* with keys used to validate received id_tokens.
18971897
* This is taken out of the disovery document. Can be set manually too.
18981898
*/
1899-
public jwks?: object;
1899+
public jwks?: object &#x3D; null;
19001900

19011901
/**
19021902
* Map with additional query parameter that are appended to
19031903
* the request when initializing implicit flow.
19041904
*/
1905-
public customQueryParams?: object;
1905+
public customQueryParams?: object &#x3D; null;
19061906

19071907
public silentRefreshIFrameName? &#x3D; &#x27;angular-oauth-oidc-silent-refresh-iframe&#x27;;
19081908

@@ -1931,7 +1931,7 @@ <h3 id="inputs">
19311931
/**
19321932
* Url for the iframe used for session checks
19331933
*/
1934-
public sessionCheckIFrameUrl?: string;
1934+
public sessionCheckIFrameUrl?: string &#x3D; null;
19351935

19361936
/**
19371937
* Name of the iframe to use for session checks

angular-oauth2-oidc/docs/classes/JwksValidationHandler.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ <h3 id="inputs">
814814
let alg &#x3D; params.idTokenHeader[&#x27;alg&#x27;];
815815

816816
if (kid) {
817-
key &#x3D; keys.find(k &#x3D;&gt; k[&#x27;kid&#x27;] &#x3D;&#x3D;&#x3D; kid &amp;&amp; k[&#x27;use&#x27;] &#x3D;&#x3D;&#x3D; &#x27;sig&#x27;);
817+
key &#x3D; keys.find(k &#x3D;&gt; k[&#x27;kid&#x27;] &#x3D;&#x3D;&#x3D; kid /* &amp;&amp; k[&#x27;use&#x27;] &#x3D;&#x3D;&#x3D; &#x27;sig&#x27; */);
818818
}
819819
else {
820820
let kty &#x3D; this.alg2kty(alg);

angular-oauth2-oidc/docs/injectables/OAuthService.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ <h3 id="methods">
14401440
<td class="col-md-4">
14411441

14421442
<div class="io-description">
1443-
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
1443+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
14441444

14451445
</div>
14461446
</td>
@@ -2214,7 +2214,7 @@ <h3 id="inputs">
22142214
}
22152215

22162216
public loadDiscoveryDocumentAndTryLogin() {
2217-
this.loadDiscoveryDocument().then((doc) &#x3D;&gt; {
2217+
return this.loadDiscoveryDocument().then((doc) &#x3D;&gt; {
22182218
return this.tryLogin();
22192219
});
22202220
}

angular-oauth2-oidc/docs/js/search/search_index.js

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

angular-oauth2-oidc/src/auth.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class AuthConfig {
4343
*/
4444
public requestAccessToken? = true;
4545

46-
public options?: any;
46+
public options?: any = null;
4747

4848
/**
4949
* The issuer's uri.
@@ -63,13 +63,13 @@ export class AuthConfig {
6363
/**
6464
* Url of the token endpoint as defined by OpenId Connect and OAuth 2.
6565
*/
66-
public tokenEndpoint?: string;
66+
public tokenEndpoint?: string = null;
6767

6868
/**
6969
* Url of the userinfo endpoint as defined by OpenId Connect.
7070
*
7171
*/
72-
public userinfoEndpoint?: string;
72+
public userinfoEndpoint?: string = null;
7373

7474
public responseType? = 'token';
7575

@@ -112,7 +112,7 @@ export class AuthConfig {
112112
* it does not bring additional security and is therefore
113113
* as good as using no password.
114114
*/
115-
public dummyClientSecret?: string;
115+
public dummyClientSecret?: string = null;;
116116

117117

118118
/**
@@ -134,13 +134,13 @@ export class AuthConfig {
134134
* with keys used to validate received id_tokens.
135135
* This is taken out of the disovery document. Can be set manually too.
136136
*/
137-
public jwks?: object;
137+
public jwks?: object = null;
138138

139139
/**
140140
* Map with additional query parameter that are appended to
141141
* the request when initializing implicit flow.
142142
*/
143-
public customQueryParams?: object;
143+
public customQueryParams?: object = null;
144144

145145
public silentRefreshIFrameName? = 'angular-oauth-oidc-silent-refresh-iframe';
146146

@@ -169,7 +169,7 @@ export class AuthConfig {
169169
/**
170170
* Url for the iframe used for session checks
171171
*/
172-
public sessionCheckIFrameUrl?: string;
172+
public sessionCheckIFrameUrl?: string = null;
173173

174174
/**
175175
* Name of the iframe to use for session checks

angular-oauth2-oidc/src/oauth-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class OAuthService
153153
}
154154

155155
public loadDiscoveryDocumentAndTryLogin() {
156-
this.loadDiscoveryDocument().then((doc) => {
156+
return this.loadDiscoveryDocument().then((doc) => {
157157
return this.tryLogin();
158158
});
159159
}

angular-oauth2-oidc/src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-oauth2-oidc",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/manfredsteyer/angular-oauth2-oidc"

angular-oauth2-oidc/src/token-validation/jwks-validation-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class JwksValidationHandler extends AbstractValidationHandler {
4040
let alg = params.idTokenHeader['alg'];
4141

4242
if (kid) {
43-
key = keys.find(k => k['kid'] === kid && k['use'] === 'sig');
43+
key = keys.find(k => k['kid'] === kid /* && k['use'] === 'sig' */);
4444
}
4545
else {
4646
let kty = this.alg2kty(alg);

sample/src/app/app.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { noDiscoveryAuthConfig } from './auth-no-discovery.config';
12
import { googleAuthConfig } from './auth.google.config';
23
import { authConfig } from './auth.config';
34
import { FlightHistoryComponent } from './flight-history/flight-history.component';
45
import { Component } from '@angular/core';
5-
import { OAuthService } from 'angular-oauth2-oidc';
6+
import { OAuthService, AuthConfig } from 'angular-oauth2-oidc';
67
import { JwksValidationHandler } from 'angular-oauth2-oidc';
78
import { Router } from "@angular/router";
89

@@ -16,13 +17,20 @@ export class AppComponent {
1617
private router: Router,
1718
private oauthService: OAuthService) {
1819

20+
// this.configureWithoutDiscovery();
1921
this.configureWithNewConfigApi();
2022
// this.configureAuth();
2123
// this.configurePasswordFlow();
2224

2325
}
2426

2527

28+
private configureWithoutDiscovery() {
29+
this.oauthService.configure(noDiscoveryAuthConfig);
30+
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
31+
this.oauthService.tryLogin();
32+
}
33+
2634
// This api will come in the next version
2735
private configureWithNewConfigApi() {
2836

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { AuthConfig } from 'angular-oauth2-oidc';
2+
3+
export const noDiscoveryAuthConfig: AuthConfig = {
4+
'clientId':
5+
'1004270452653-m396kcs7jc3970turlp7ffh6bv4t1b86.apps.googleusercontent.com',
6+
'redirectUri': 'http://localhost:4200/index.html',
7+
'postLogoutRedirectUri': '',
8+
'loginUrl': 'https://accounts.google.com/o/oauth2/v2/auth',
9+
'scope': 'openid profile email',
10+
'resource': '',
11+
'rngUrl': '',
12+
'oidc': true,
13+
'requestAccessToken': true,
14+
'options': null,
15+
'issuer': 'https://accounts.google.com',
16+
'clearHashAfterLogin': true,
17+
'tokenEndpoint': 'https://www.googleapis.com/oauth2/v4/token',
18+
'userinfoEndpoint': 'https://www.googleapis.com/oauth2/v3/userinfo',
19+
'responseType': 'token',
20+
'showDebugInformation': true,
21+
'silentRefreshRedirectUri': 'http://localhost:4200/silent-refresh.html',
22+
'silentRefreshMessagePrefix': '',
23+
'silentRefreshShowIFrame': false,
24+
'siletRefreshTimeout': 20000,
25+
'silentRefreshTimeout': 20000,
26+
'dummyClientSecret': null,
27+
'requireHttps': 'remoteOnly',
28+
'strictDiscoveryDocumentValidation': false,
29+
'jwks': {
30+
'keys': [
31+
{
32+
'kty': 'RSA',
33+
'alg': 'RS256',
34+
'use': 'sig',
35+
'kid': '7540561fdb04b89d824a1b7b9e8849873e7cb50e',
36+
'n':
37+
'sSFZrLIrXzvXBCehdPR10T-mfHWFU5ZtGzW9buI7wT_tJzZ1SRUc2l1NH92kGV9bmWRtDLjWcWFwMG7rbjX25-R-62lD1k15gQiO4bhx7gbV05e36os2vXTs0ypj9GS9y8X_2fYAnxxulMLwz4m24Ejo2tQI43-V-3Tec6cSXe0FjhRaPbGdS8GHPDKkhpJ1NHMZ38vhddIImOfvtVuz3lt_zwjBsAC6Q7PHs2GOm3KtC22DCwXMYSri4QOQcasuvTlZxIQSIksTyuH0T02IH5SJvQZSx46Vfq8BM4JP-zEEjzadoyxQPouRM6TrUeaqNv5B1f1lbH6G0G_r_ddYWQ',
38+
'e': 'AQAB'
39+
},
40+
{
41+
'kty': 'RSA',
42+
'alg': 'RS256',
43+
'use': 'sig',
44+
'kid': '778233e8f6f342ea09e867aad25f543adeebf372',
45+
'n':
46+
'8MMxQ9F7R1zJ57QvLX-HqUlTVLLofCzZ3-lxohJr8ivJDGZoCqll7ZTNO0nGMgnPpIO-3BQLkaNGQDCpnID1vNIjClFFl0E3cN5bDX15uxCQeQDsm25fTlphpy5FkdoHCviswtrsl2KKUPeRlKqCqMjlDO27KuxIwzIPdNSqv4tseZmI-biFt2JlO9htgODrVqaawdm27t9HcWfOK_a5czRFDHWck2-ZwjbCOF9CtF1ggYm11aV0TElExXr5fgjAQdZ1yGmJvir127BRUgyIy5cpyf7VRRf2Cv7whSMoVJr4W3OK0H9vkuFLnlBiBNYQmH_eWy5U4jBfZjBqvA7Oww',
47+
'e': 'AQAB'
48+
},
49+
{
50+
'kty': 'RSA',
51+
'alg': 'RS256',
52+
'use': 'sig',
53+
'kid': '8ec17994394464d95b0b3d906326f1cdde8aee64',
54+
'n':
55+
'w49KfvzGWVXH4vyUxvP29_QTmJfvLp4RPT1WlI6Wo2aNvn6j9vRSLDrK2CnOvvrrlUKvR-8FTcyNi9pRKXDwDhEJcyVFBJVi4PqDh0KIX_dOGYCulr5FUvU0HXQxlMWSHIsJjfGbMMUwM0p09y8KHL-kipiipzn80EpBmrI4Q3t6XOAZJSmbIPaGZJDjyoWWV0TDdVDBMfkqII6tOOB7Ha189AZjz7FHYXR9CIc0Jm6rFy0tVpdHFEG3ptcNQEDQ5ghyMM4PDM4ZmQ5uk3WgHVqnpdmGEfKekLwmYFWgnI-ux_MabltIxr9TE1qubEmebM64rOusHBF0mSbEwggbyw',
56+
'e': 'AQAB'
57+
}
58+
]
59+
},
60+
'customQueryParams': null,
61+
'silentRefreshIFrameName': 'angular-oauth-oidc-silent-refresh-iframe',
62+
'timeoutFactor': 0.75,
63+
'sessionCheckIntervall': 3000,
64+
'sessionCheckIFrameName': 'angular-oauth-oidc-check-session-iframe',
65+
'disableAtHashCheck': false,
66+
'skipSubjectCheck': false
67+
}

0 commit comments

Comments
 (0)