Skip to content

Commit fb361a0

Browse files
committed
Revert "fix issue with issuer and google oidc"
Reverting due to unnecessary whitespace changes. This reverts commit 535b4fe.
1 parent 535b4fe commit fb361a0

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

projects/lib/src/oauth-service.ts

+34-35
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class OAuthService extends AuthConfig {
6565
* The received (passed around) state, when logging
6666
* in with implicit flow.
6767
*/
68-
public state?= '';
68+
public state? = '';
6969

7070
protected eventsSubject: Subject<OAuthEvent> = new Subject<OAuthEvent>();
7171
protected discoveryDocumentLoadedSubject: Subject<object> = new Subject<object>();
@@ -164,7 +164,7 @@ export class OAuthService extends AuthConfig {
164164
public setupAutomaticSilentRefresh(params: object = {}, listenTo?: 'access_token' | 'id_token' | 'any') {
165165
this.events.pipe(filter(e => e.type === 'token_expires')).subscribe(e => {
166166
const event = e as OAuthInfoEvent;
167-
if (listenTo == null || listenTo === 'any' || event.info === listenTo) {
167+
if ( listenTo == null || listenTo === 'any' || event.info === listenTo ) {
168168
this.silentRefresh(params).catch(_ => {
169169
this.debug('Automatic silent refresh did not work');
170170
});
@@ -1106,15 +1106,15 @@ export class OAuthService extends AuthConfig {
11061106
}
11071107

11081108
if (this.config.responseType) {
1109-
this.responseType = this.config.responseType;
1109+
this.responseType = this.config.responseType;
11101110
} else {
1111-
if (this.oidc && this.requestAccessToken) {
1112-
this.responseType = 'id_token token';
1113-
} else if (this.oidc && !this.requestAccessToken) {
1114-
this.responseType = 'id_token';
1115-
} else {
1116-
this.responseType = 'token';
1117-
}
1111+
if (this.oidc && this.requestAccessToken) {
1112+
this.responseType = 'id_token token';
1113+
} else if (this.oidc && !this.requestAccessToken) {
1114+
this.responseType = 'id_token';
1115+
} else {
1116+
this.responseType = 'token';
1117+
}
11181118
}
11191119

11201120
const seperationChar = that.loginUrl.indexOf('?') > -1 ? '&' : '?';
@@ -1500,8 +1500,7 @@ export class OAuthService extends AuthConfig {
15001500
return Promise.reject(err);
15011501
}
15021502

1503-
/* Fix for google oidc */
1504-
if (claims.iss !== this.issuer && 'https://' + claims.iss !== this.issuer) {
1503+
if (claims.iss !== this.issuer) {
15051504
const err = 'Wrong issuer: ' + claims.iss;
15061505
this.logger.warn(err);
15071506
return Promise.reject(err);
@@ -1553,30 +1552,30 @@ export class OAuthService extends AuthConfig {
15531552

15541553

15551554
return this.checkAtHash(validationParams)
1556-
.then(atHashValid => {
1557-
if (
1558-
!this.disableAtHashCheck &&
1559-
this.requestAccessToken &&
1560-
!atHashValid
1561-
) {
1562-
const err = 'Wrong at_hash';
1563-
this.logger.warn(err);
1564-
return Promise.reject(err);
1565-
}
1566-
1567-
return this.checkSignature(validationParams).then(_ => {
1568-
const result: ParsedIdToken = {
1569-
idToken: idToken,
1570-
idTokenClaims: claims,
1571-
idTokenClaimsJson: claimsJson,
1572-
idTokenHeader: header,
1573-
idTokenHeaderJson: headerJson,
1574-
idTokenExpiresAt: expiresAtMSec
1575-
};
1576-
return result;
1577-
});
1555+
.then(atHashValid => {
1556+
if (
1557+
!this.disableAtHashCheck &&
1558+
this.requestAccessToken &&
1559+
!atHashValid
1560+
) {
1561+
const err = 'Wrong at_hash';
1562+
this.logger.warn(err);
1563+
return Promise.reject(err);
1564+
}
1565+
1566+
return this.checkSignature(validationParams).then(_ => {
1567+
const result: ParsedIdToken = {
1568+
idToken: idToken,
1569+
idTokenClaims: claims,
1570+
idTokenClaimsJson: claimsJson,
1571+
idTokenHeader: header,
1572+
idTokenHeaderJson: headerJson,
1573+
idTokenExpiresAt: expiresAtMSec
1574+
};
1575+
return result;
1576+
});
15781577

1579-
});
1578+
});
15801579
}
15811580

15821581
/**

0 commit comments

Comments
 (0)