0
votes

The MSAL for Angular documentation leads me to the JavaScript documentation for MSAL

https://www.npmjs.com/package/@azure/msal-angular

https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/FAQs Q4. How to get single sign-on in my application with MSAL.js

https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-sso

"Applications on different domain When applications are hosted on different domains, the tokens cached on domain A cannot be accessed by MSAL.js in domain B.

This means that when users signed in on domain A navigate to an application on domain B, they will be redirected or prompted with the Azure AD page. Since Azure AD still has the user session cookie, it will sign in the user and they will not have to re-enter the credentials. If the user has multiple user accounts in session with Azure AD, the user will be prompted to pick the relevant account to sign in with."

MSAL for Angular API has extraQueryParameters as string type which is different from the JavaScript instructions. loginRedirect(consentScopes?: string[], extraQueryParameters?: string): void;

Currently the user is prompted all the time to sign in. How do I get MSAL for Angular to detect the SSO that exists without prompting the user?

1

1 Answers

0
votes

According to the developers of MSAL.js and its angular wrapper: "This is a known shortcoming of MSAL Angular, but will be addressed soon, as we are currently working to upgrade MSAL Angular to use MSAL 1.x, where this works as expected. I'll post an update here when there is a version you can try.

We'll also make sure to make it more clear in the documentation how to do this."Source Issue

In the meantime one could customize the librarys code. The root issue for your described behaviour is that the developers always enforce "prompt=&select_account" at a login via redirect. In order to avoid that login screen displaying again one can replace it by ""prompt=&none"