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.

Silent logout, login without cache token

See original GitHub issue

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

2.20.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

2.0.6

Description

Hi guys, i have a little special use case: I have a signed in user in my application, but the app requires also an four eyes principle. So I have to aquire a token(which will be checked in backend) for a second user with prompt login. This is where my problems start: If i aquire the token for the second user, the second user stays logged in and i have to show the logout page where the second user must interactivate again. Currently this is a security issue, because if logout is not properly executed it is possible to sign in to all microsoft services via SSO So i look for a solution to aquire a token without being cached or an option to logout silent. Can you help me please?

MSAL Configuration

auth: {
    clientId: 'XXX',
    authority: 'https://login.microsoftonline.com/XXX/',
    redirectUri: '/',
    postLogoutRedirectUri: '/logout'
  },

  cache: {
    cacheLocation: BrowserCacheLocation.SessionStorage,
    storeAuthStateInCookie: false
  }

Relevant Code Snippets

this.msalSvc.acquireTokenPopup({ loginHint: user.userPrincipal, prompt: 'login', scopes: ['api://XXX/sign']} as PopupRequest).subscribe({
...
this.msalSvc.instance.logoutPopup({ account: response.account, postLogoutRedirectUri: null});

Identity Provider

Azure AD / MSA

Source

External (Customer)

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
tnorlingcommented, Jan 10, 2022

@bumbel42so The silent sign-out feature is committed but we don’t have an ETA to share at the moment. We will link the pull request containing this feature when it is ready so that you can track its progress. New versions of our libraries are released on the first Monday of every month.

1reaction
jasonnuttercommented, Jan 24, 2022

Assigning to @hectormmg, who will be working on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Silent Authentication - Auth0
You can make a silent authentication request to get new tokens as long as the user still has a valid session at Auth0....
Read more >
Single-page application: Sign-in and Sign-out - Microsoft Learn
If your application already has access to an authenticated user context or ID token, you can skip the login step, and directly acquire...
Read more >
azure/msal-node: Is there a way to log out / invalidate tokens?
A logout operation will contain multiple steps: Removing the account and the tokens from the msal application cache. Redirecting to the AAD ...
Read more >
Logout endpoint - Amazon Cognito - AWS Documentation
When you want to redirect your user to your /login endpoint to reauthenticate and pass tokens to your app, add a redirect_uri parameter....
Read more >
OpenID Connect & OAuth 2.0 API - Okta Developer
Revoke an access or refresh token. /logout, End the session associated with the given ID token. /keys, Return public keys used to sign...
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