Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredsteyer committed May 20, 2018
1 parent 8766c4d commit 2c6ba16
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 16 additions & 5 deletions projects/lib/src/oauth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ export class OAuthService extends AuthConfig {
const redirectUri = this.silentRefreshRedirectUri || this.redirectUri;
this.createLoginUrl(null, null, redirectUri, noPrompt, params).then(url => {
iframe.setAttribute('src', url);

if (!this.silentRefreshShowIFrame) {
iframe.style['display'] = 'none';
}
Expand Down Expand Up @@ -1703,7 +1704,8 @@ export class OAuthService extends AuthConfig {
if (noRedirectToLogoutUrl) {
return;
}
if (!id_token) {

if (!id_token && !this.postLogoutRedirectUri) {
return;
}

Expand All @@ -1721,13 +1723,22 @@ export class OAuthService extends AuthConfig {
.replace(/\{\{id_token\}\}/, id_token)
.replace(/\{\{client_id\}\}/, this.clientId);
} else {

let params = new HttpParams();

if (id_token) {
params = params.set('id_token_hint', id_token);
}

const postLogoutUrl = this.postLogoutRedirectUri || this.redirectUri;
if (postLogoutUrl) {
params = params.set('post_logout_redirect_uri', postLogoutUrl);
}

logoutUrl =
this.logoutUrl +
(this.logoutUrl.indexOf('?') > -1 ? '&' : '?') +
'id_token_hint=' +
encodeURIComponent(id_token) +
'&post_logout_redirect_uri=' +
encodeURIComponent(this.postLogoutRedirectUri || this.redirectUri);
params.toString()
}
location.href = logoutUrl;
}
Expand Down
2 changes: 2 additions & 0 deletions projects/sample/src/app/auth.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const authConfig: AuthConfig = {
// The first three are defined by OIDC. The 4th is a usecase-specific one
scope: 'openid profile email voucher',

// silentRefreshShowIFrame: true,

showDebugInformation: true,

sessionChecksEnabled: false
Expand Down

0 comments on commit 2c6ba16

Please sign in to comment.