Questions tagged [react-aad-msal]
42 questions
8
votes
1 answer
Unhandled Rejection (ClientAuthError): User login is required. For silent calls, request must contain either sid or login_hint
I am making an application in React and use the "react-aad-msal" library (https://www.npmjs.com/package/react-aad-msal), which is authenticated and authorized using AzureAD and then receives data (list tasks) from API (as
I took this example…

user13572001
- 81
- 1
- 3
6
votes
1 answer
testing component with react-aad-msal
I need to write unit test cases for below class by mocking react-aad-msal.
how can I mock it? I have read that enzyme mock the components, but I get error as
console.error node_modules/react-aad-msal/dist/commonjs/Logger.js:69
[ERROR]…

Swapana Thorat
- 61
- 1
- 3
5
votes
0 answers
How Do I Mock MSAL Authentication?
I have added authentication to my web app using MSAL which connects to Azure Active Directory B2C.
This works fine when I am connected and can access the Microsoft site. However, it fails when I am not.
e.g. on a plane or in a firewalled build…

opticyclic
- 7,412
- 12
- 81
- 155
4
votes
1 answer
Azure Access Token react-aad-msal
I am trying to use the following library "react-aad-msal" to authenticate my user in Azure and retrieve the access token. And once retrieve I will be passing it to my secure api. The problem is I cannot get the access token every time I log in.…

Hawk
- 514
- 1
- 7
- 22
3
votes
2 answers
Adding MsalAuthenticationTemplate for some routes causes all routes to require login
I’ve got a ReactJS website in which I am trying to use "@azure/msal-react": "^1.0.0-beta.1", and ran into some issues that have me flummoxed.
Most of my pages are open to the public. Some require login. If I add the MSALAuthenticationTemplate as…

Joe B
- 66
- 1
- 5
2
votes
1 answer
MSAL Auth stores authentication information in local storage - How to limit storage of information
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
2
votes
2 answers
MSAL all tenants sign on with pop up redirects inside popup
I used the MSAL quickstart for react - creating a single tenant app registration for a SPA. The react code worked with the pop up meaning a user could sign in and the pop up went away.
Now I need to move from single tenant to multi-tenant with the…

DFBerry
- 1,818
- 1
- 19
- 37
2
votes
0 answers
loginPopup does not redirect to redirectUri in the original tab but opens redirectUri on Popup in D365
I'm using MSAL in a react based SPA and a PCF component which is imported into a canvas app and this canvas app is embedded into Dynamic365 Field service CRM.
I have created a Azure AAD app registration and added these redirectUri in Single Page…

Dhruvil Dave
- 109
- 1
- 20
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
0 answers
Error 431 Request Header Fields Too Large after enabling Msal authentication to app
Due to loo long cookie send in request header azure webapp returning 431 error ie request headers field too large. I read a lot of issues on Github but nothing working. I post my config :
const config = {
auth: {
authority:…

Neska
- 23
- 3
2
votes
1 answer
Error from chokidar while using react-aad-msal
I am working with azure active directory and I get this weird module not found error followed by a chokidar error :
./node_modules/react-aad-msal/dist/commonjs/MsalAuthProvider.js
Module not found: Can't resolve 'msal' in…

Paul Louppe
- 53
- 6
2
votes
1 answer
Calling web api from react SPA using react-aad-msal missing scope
I am calling a protected web api from react SPA web app. Both spa and the web api have been registered with AzureAD and each registered for each other via "Expose API" and "API permissions".
After the client is authenticated then before calling the…

Program Haven
- 213
- 2
- 9
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
1 answer
AADSTS500112: The reply address does not match the reply address provided when requesting Authorization code
I searched through the internet yet I couldn't find this specific problem.
AADSTS500112: The reply address 'http://localhost:3000/#/training' does not match the reply address 'http://localhost:3000/' provided when requesting Authorization code.
I am…

Ozan Mudul
- 750
- 1
- 9
- 20
1
vote
1 answer
react-aad-msal authProvider.getAccessToken() reloads the component indefinitely
I have added a axios interceptor within which authProvider.getAccessToken() is called to fetch token and add to header of each request.
Here is my axiosInterceptor.js
import axios from 'axios'
import { authProvider } from '../authProvider'
export…

Shreyas R
- 11
- 2