0

I have a question regarding an application that uses Azure Authentication using MSAL.

When using MSAL in an application (via typescript/ javascript) a popup/ prompt appears for the user the enter their username and password (similar to the screenshot below).

enter image description here

After providing the details, a number of properties are set in local storage. The significance of this is that when the user next logs into the application, they do no need to provide their username and password again, thus the prompt does not appear. This is a "acquiring the token silently".

One of the things I'm looking for is whether to acquire the token silently (i.e. to login via Azure) without the popup appearing, on the first launch of the application. Is there any way of achieving this via using MSAL?

thanks.

rm12345
  • 1,089
  • 3
  • 18
  • 32
  • There's a couple of different ways to configure the sign-in, might need to switch to a different method depending on what's appropriate: https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-authentication-flows – mmking Feb 21 '21 at 01:08
  • DId you mean that after launching the app with id and pwd for the first time, and after that it will keep signing in forever and never be asked to login again until the cookie be cleaned manually? – Tiny Wang Feb 21 '21 at 06:28
  • Pls accept answers if they are helpful. It will be an award for answer posters and others will be more glad to assist you if you accept answers on time.Personally, I will not help the one who never accept answers – Stanley Gong Feb 23 '21 at 01:41
  • If my solution inspires or helps you, you mark my answer as [accepted](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) , Tks~ – Jason Pan Feb 24 '21 at 07:27

1 Answers1

0

To disable pop-up login, you can use ROPC flow. That is, by sending an Http request, access_token and id_token are obtained.

Http Request:

enter image description here

Http Response:

enter image description here

Microsoft officially does not recommend this method, but some specific scenarios will need to disable pop-up login, so it is currently officially supported.

enter image description here

Related Posts:

1. Is there a way to improve the performance of MSAL-browser js login?

2. Could I sign into embedded PowerApp via Microsoft LiveID Account “quietly”?

Jason Pan
  • 15,263
  • 1
  • 14
  • 29