AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.64k stars 2.65k forks source link

Can't bypass the selection of user even adding the logoutRedirect method #7042

Closed TahaDGumama closed 5 months ago

TahaDGumama commented 5 months ago

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

2

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

None

Public or Confidential Client?

Confidential

Description

Can't bypass the selection of user even adding the logoutRedirect method

Error Message

No response

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

MSAL Configuration

export function MSALInstanceFactories(): IPublicClientApplication {
    return new PublicClientApplication({
        auth: {
            clientId: Config.clientId,
            authority: Config.authority,
            redirectUri: Config.redirectUri,
            postLogoutRedirectUri: Config.redirectUri
        },
        cache: {
            cacheLocation: BrowserCacheLocation.LocalStorage,
            storeAuthStateInCookie: isIE
        }
    });
}

Relevant Code Snippets

public logOut(url : string) {
       const account = this.msalService.instance.getActiveAccount();
       this.msalService.logoutRedirect({ postLogoutRedirectUri: url, account: account});
      };
    };

Reproduction Steps

  1. Log in on site
  2. sign out
  3. show selecting which user to sign out

Expected Behavior

  1. Log in on site
  2. sign out
  3. directly sign out no selecting of user which to sign out

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, Edge

Regression

@azure/msal-browser 2.0.0

Source

Internal (Microsoft)

tnorling commented 5 months ago

Please see here for instructions regarind promptless logout. You will need to make sure you have:

  1. enabled the login_hint optional claim on your app registration
  2. You are passing it into the logoutRedirect function either as logoutHint or embedded in the account
  3. You are using a version of MSAL that supports it (2.22.0+)

If you've done all 3 and it still isn't working please file a ticket here