Questions tagged [msal-react]
113 questions
2
votes
0 answers
An update to MsalAuthenticationTemplate ran an effect , error when writing unit test with jest in reactjs
I am writing unit tests with jest, my unit tests are running but I am always getting below error.
Due to this error, it does not show coverage and test description which ran successfully
console.error
Warning: An update to…

Mandeep Singh
- 1,287
- 14
- 34
2
votes
1 answer
How to stop redirect after logout in msal react
Am just doing msal.logout() and it redirects to logout screen and then ask for login and then after login it navigates to www.office.com , How can I just stop all redirections after logout.
Here is the config
export const msalConfig: Configuration =…

Deepak Kothari
- 1,601
- 24
- 31
2
votes
1 answer
Callback Event after successful login msal-react
I'm using to redirect the user to the login page. How can I perform a function after successful login? Is there a callback event I can hook in?

Romeo
- 1,791
- 8
- 25
- 41
2
votes
0 answers
Azure AD with msal-node: How to get user profile?
I have a nodejs/expressjs application that uses @azure/msal-node library for user-login. For this, I followed the official Microsoft Documentation.
User login works like a charm.
But now I have to access the user's profile, and most important, the…

RuntimeError
- 1,332
- 4
- 23
- 41
2
votes
1 answer
How to get azure ad refresh token with react
I am doing a project with React, msal-react, and msal-browser.
I can get an access token with functions provided with msal-react library, but I cannot get the refresh token manually.
I can see from the network that a token request is performed when…

Conan DING
- 21
- 1
- 2
2
votes
2 answers
Intermittent problem using loginPopup MSAL JS in a REACT PWA
Good morning,
I'm using MSAL JS in order to authenticate users in a PWA application developed using REACT.
Sometimes login works perfectly, redirecting users to the home page of the app. Other times login popup opens, users insetr their login but…

user15645317
- 31
- 1
- 4
1
vote
1 answer
How can I obtain access tokens for different scopes in a micro frontend application and handle token expiry?
I'm developing a micro frontend application where the container app handles user authentication and stores tokens in sessionStorage. These tokens are needed to access various APIs with different scopes. What's the best way to manage tokens for…

SDK
- 1,356
- 3
- 19
- 44
1
vote
0 answers
How to specify the Audience for OBO Flow
I am using the on-behalf-of flow where the token acquired on the front-end is then forwarded to a middle-tier-application. That middle-tier-application can then use that token to acquire tokens to other APIs (like Microsoft's Graph API) or to access…

Ryan Pierce Williams
- 650
- 3
- 14
1
vote
0 answers
Error Integrating React JS with Keycloak 20.0.5 using @azure/msal-browser module
Hi I was attempting to integrate Keycloak version 20.0.5 with React for authentication using @azure/msal-browser. The integration is successful with versions lower than 20 but with versions above 20 I get the error below:
[org.keycloak.events]…

mithamovic
- 31
- 4
1
vote
1 answer
Understanding the Usage and Purpose of InteractionType in @azure/msal-browser
I'm currently working with the @azure/msal-browser library and I came across the term InteractionType.
Which is mentioned as an Enum in the documentation link to documentation (archived).
However, I couldn't find detailed information on how to use…

SKJ
- 237
- 2
- 11
1
vote
1 answer
Using MSAL.js to integrate React Single-page applications with Azure Active Directory
I'm learning about authentication on React application using MSAL and I was following this: https://www.youtube.com/watch?v=7oPSL5wWeS0
I created an application in Microsoft tenant
and made the code updates:
index.tsx
import {…

user989988
- 3,006
- 7
- 44
- 91
1
vote
0 answers
Error "invalid_grant" after using msal token from msal-react
I need your help with an unreachable error when msal token expire, specifically an invalid_grant error. I have a exception but this error only is showing on console. Thanks you
const refreshToken = async () => {
const request = {
account:…

smontecinos
- 11
- 1
1
vote
1 answer
How to Redirect automatically to a page/path on login - MSAL React SPA
I am working on a single page application (SPA) app that grants access to specific paths in the application, based on roles setup in Azure AD for the user logging in. As per this…

Skadoosh
- 699
- 2
- 11
- 27
1
vote
2 answers
InteractionRequiredAuthError: invalid_grant: AADSTS50076
Error message: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access 'bxxx-xxxx-xxxxa'.
I am getting this error intermittently, while accessing token with…

Sudhir Kulat
- 11
- 2
1
vote
3 answers
Logout all tabs with msal-react when using localStorage
I have a React 18.x with NextJS 12.x application that uses msal-react 1.4.4 (relies on msal-browser 2.28.0) and Azure B2C for authentication. My config is like this:
export const msalConfig: Configuration = {
auth: {
clientId: clientId as…

Jeroen
- 60,696
- 40
- 206
- 339