Questions tagged [msal-react]
113 questions
1
vote
1 answer
Next.js/MSAL: Text does not match server-rendered html
I am trying to set up next.js with azure ad b2c using the MSAL (react) library. Msal provides a nice component to handle auth.
I made a minimum next.js page.
import { InteractionType } from…

J. Reku
- 509
- 1
- 5
- 15
1
vote
0 answers
Anyway to tell in msal.js if authentication was an existing user login or a new user signup
We are using @azure/msal-browser and @azure/msal-react and have the standard authentication flow in our React app, as is show in the code samples below.
We are using Azure External Identities user flow where the users can either login or, if they…

savreline
- 131
- 1
- 7
1
vote
1 answer
React MSAL: how to logout from all devices?
We have an application where we use msal-react for login/logout.
Is there a way to log out of all devices with which a user is logged in when logging out?
Unfortunately, nothing can be found in the official documentation about this.
We also have a…

Codehan25
- 2,704
- 10
- 47
- 94
1
vote
1 answer
How to pass custom code_verifier on msal 2.0 for Azure B2C?
Generally, MSAL 2.0 auto-generates the code and code_verifier by itself.
But Here, I have my custom flow when half part is done on another code i.e. to generate code_challenge.
But When I call from front-end I am unable to find a way that I can pass…

Riddhish Bambhroliya
- 49
- 9
1
vote
3 answers
Problem with Invalid hook call for react-msal with Axios
I'm using react-msal to my application. I need to acquire the access token and attach it to the axios globally, but unfortunately, they only provide hooks to get the access token (as far as I know).
So far, here's my api.js file.
import axios from…

wowew
- 11
- 2
1
vote
1 answer
How to integrate Azure Ad B2C login in my Electron React App?
I am trying to integrate Azure Ad B2C login in my Electron React App. I have used the MSAL-React Wrapper library for the Login authentical and it works fine in dev mode because of webserver but in production it doesn't work because no webserver in…

vishnu
- 363
- 3
- 20
1
vote
1 answer
React SPA Azure ADB2C password reset user flow
I'm following a sample for React w/ msal and AADB2C.
I want to run the reset password flow if an user clicks "Forgot my password" in my signIn flow. From here I saw that I need to handle this case:
if (event.eventType === EventType.LOGIN_FAILURE) {
…

Vivere
- 1,919
- 4
- 16
- 35
1
vote
0 answers
Cannot return authenticated account information (using MSAL)
Intro:
I'm trying to configure react authentication with Azure B2C, based on https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/3-Authorization-II/2-call-api-b2c/SPA/src
Goal:
I want the users to be able to login and…

D.K. Ananias
- 19
- 4
1
vote
1 answer
How to save login state in MSAL react router?
My App.js file has thise router implemented
} />
}/>
…

Ritik Agarwal
- 11
- 1
1
vote
1 answer
Azure B2C session causing unintended flow
Can somebody help me make sense of this behaviour with Azure AD B2C and reveal what I'm not understanding when it comes to the SSO session.
I have a fairly complex custom policy for signing in that includes sub journeys for both a custom Sign Up and…

darnmason
- 2,672
- 1
- 17
- 23
1
vote
1 answer
Is this a right flow for React app on frontend and Express app on backend to authenticate and authorize users with Azure AD?
I have React app on the frontend, I have registered it at Azure AD as REACT_AZURE and I use @azure/msal-react npm package to authenticate the user.
In order to protect my Express routes, I have registered another app at Azure AD as API_AZURE, and…

Konstantin Agapov
- 207
- 3
- 10
1
vote
1 answer
How to get Azure access token with Node js API using Axios
I have a backend in Nodejs using Axios for my API calls. I need to implement Azure Authentication to get a token so I followed the sample…

Classic
- 23
- 2
- 4
1
vote
1 answer
Prevent msal-react from loading components multiple times
I'm not too far into the implementation and have it pretty bear bones and not refactored (and not great coding practices).
This is an Admin portal that uses the company's Azure Active Directory to validate users as opposed to username/password, etc.…

cjones
- 8,384
- 17
- 81
- 175
0
votes
1 answer
Passport-azure-ad MSAL Using BearerStrategy gives error
Client(React Js) - @azure/msal-react, @azure/msal-browser
Server(Express Js) - Passport-azure-ad
var options = {
identityMetadata:"https://login.microsoftonline.com//v2.0/.well-known/openid-configuration",
…
0
votes
1 answer
Authentication issues developing Outlook Web Add-In using REACT and MSAL.JS
I am developing an Outlook Web Add-In using
Yeoman generator-office
Office.Js
REACT framework
azure/msal-browser version 2.32.2
As per Microsoft/Office Add-In/MSAL team's best practice - I am performing a popup auth in the office dialogue using…

gts
- 21
- 5