+After a user selects the **Sign In** button for the first time, the `signIn` method calls `loginPopup` to sign in the user. This method opens a pop-up window with the *Microsoft identity platform endpoint* to prompt and validate the user's credentials. After a successful sign-in, `msal.js` initiates the [authorization code flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow). At this point, a PKCE protected authorization code is sent to the CORS protected token endpoint and is exhanged for tokens. A ID token, Access token, and Refresh Token are received, processed by `msal.js`, and the information contained in the token is cached. The *ID token* and contains basic information about the user, such as the user display name. If you plan to use any data provided by this token for any purposes, you need to make sure this token is validated by your backend server to guarantee that the token was issued to a valid user for your application. The *Refresh Token* is limited lifetime and expires after 24 hours. This token can be used to silently acquire new *Access Tokens*.
0 commit comments