question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

postLogoutRedirectUri not working in Angular 11 sample app running in Chrome

See original GitHub issue

Library

  • msal@1.x.x or @azure/msal@1.x.x
  • @azure/msal-browser@2.13.0
  • @azure/msal-node@1.x.x
  • @azure/msal-react@1.x.x
  • @azure/msal-angular@0.x.x
  • @azure/msal-angular@1.x.x
  • @azure/msal-angular@2.0.0-beta.2
  • @azure/msal-angularjs@1.x.x

Framework

  • Angular 11
  • React
  • Other

Description

When logging out of the Angular 11 sample app (running on localhost) I’m redirected to the Azure sign out page, but after signing out I’m not being redirected back to the postLogoutRedirectUri. The logout procedure stops at this URL: https://login.microsoftonline.com/my_tenant_id_here/oauth2/v2.0/logoutsession

Error Message

No errors messages are being thrown.

MSAL Configuration

auth: {
    clientId: 'my application client id here',
    redirectUri: '/',
    postLogoutRedirectUri: '/',
    authority: 'https://login.microsoftonline.com/my tenant id here'
},
cache: {
    cacheLocation: BrowserCacheLocation.LocalStorage,
    storeAuthStateInCookie: isIE, // set to true for IE 11. Remove this line to use Angular Universal
},

I’ve added the locahost uri to Redirect URI’s Skærmbillede 2021-04-02 kl  13 25 58

Reproduction steps

  1. Download the Angular 11 MSAL Angular v2 Sample from this repository.
  2. Change the config as shown above.
  3. Run the application.
  4. Sign in and sign out.

Expected behavior

Expected to be redirect back to the Angular 11 sample app after signing out.

Identity Provider

  • Azure AD
  • Azure B2C Basic Policy
  • Azure B2C Custom Policy
  • ADFS
  • Other

Browsers/Environment

  • Chrome
  • Firefox
  • Edge
  • Safari
  • IE
  • Other (Please add browser name here)

Regression

  • Did this behavior work before? Version:

Security

  • Is this issue security related?

Source

  • Internal (Microsoft)
  • Customer request

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
workingtitledkcommented, Apr 3, 2021

@jo-arroyo I’ve just tried a few browsers and the results are mixed. I’m on macOS. Chrome v. 89.0.4389.114: doesn’t work. Chrome v. 89.0.4389.114 (incognito): works. Firefox v. 87.0 (regular and incognito): doesn’t work. Safari v. 14.0.3: works.

0reactions
msftbot[bot]commented, May 16, 2021

workingtitledk This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has not been resolved please leave a comment to keep this open. It will be closed in 7 days if it remains stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Identity Server 4 does not redirect to Angular clients ...
I have an angular application that uses Identity Server 4 to login. This works fine when logging in, however, after logging out I'm...
Read more >
logout when browser is closed angular - You.com
I'm upgrading from Angular 9 to Angular 11, and I'm facing problem with our RouteReuseStrategy . With Angular 11, after login our app...
Read more >
Angular 10 (SPA) | cookies storage | angular auth oidc client
No redirect on identity server login page if tokens are valid. Cookies storage for persistent storage of tokens and user data. Angular 10 ......
Read more >
Securing an Angular app which uses multiple identity providers
The Angular application uses OpenID Connect code flow with PKCE ... This is not a server rendered application where the security runs in...
Read more >
User Authentication and Identity with Angular, Asp.Net Core ...
Modern application security is a complex problem ... As of March 31, 2019, the demo solution builds and runs successfully with the following ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found