Questions tagged [msal.js]
The Microsoft Authentication Library for JavaScript enables client-side JavaScript web applications, running in a web browser, to authenticate users using Azure AD for work and school accounts (AAD), Microsoft personal accounts (MSA), and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through Azure AD B2C service.
msal.js
533
questions
0
votes
0
answers
22
views
msal browser not retrieving new token for different clientId as check is only on account
We are using msal browser with session storage. We have mutiple applications on same domain so different applications load based on route. If one of our application is authenticated and we try to ...
0
votes
0
answers
46
views
MSAL Outlook Graph API Not returning refresh token with access token
I am creating an auth flow for the user to allow Mail sending through our app for email automation so therefore I need to store the accessToken and the refreshToken in my DB to automatically send ...
0
votes
1
answer
55
views
Implementing Azure B2C single sign on shared between multiple apps
I want to implement SSO accross multiple apps. My requirement is that we will login in one app and switch between different apps withoout having to login again.
App 1- React Spa
App 2 - .Net based.
I ...
0
votes
0
answers
22
views
Automatically acquire access token for site hosted in sharepoint to authenticate in on-premise web api
Is it possible to silently, completely without user interaction, acquire access token from login.microsoftonline.com, to authenticate web api running on-premise?
I have registered an app in Azure ...
0
votes
0
answers
23
views
Msteams bot custom tab sso failing with error code 2605 ServerTemporarilyUnavailable
we have msteams bot with custom tab in it. We use msal.js for automated sso as per this doc. Since today morning, we are suddenly getting the error:
{"Description":"(pii)","...
0
votes
1
answer
43
views
Get change notifications teams presence using Microsoft Graph API without delegated permissions
I am working on a application which needs ms teams change notifications for presence to update the frontend. The issue is this application will open in another application as an IFRAME, I have tried ...
0
votes
1
answer
91
views
Cannot authenticate with SSO between multiple web apps with Azure B2C and MSAL.js Angular
We are building multiple web applications that use Azure B2C user flows for authentication. They are hosted on our servers within the same domain, but different subdomains to differentiate them. The ...
1
vote
0
answers
30
views
Microsoft.Identity.Client.MsalServiceException
I am trying to send emails from my angularjs application using MSAL setup, getting these exceptions:
Exception thrown: 'System.Net.WebException' in mscorlib.dll Exception
thrown: 'Microsoft.Identity....
0
votes
1
answer
72
views
Configure Azure Resource Manager API for an Angular Web App
I have been trying to call the azure resource manager api to get a list of the resources in a subscription but as soon as I call the method , it gives me an error and the user isn't able to ...
0
votes
2
answers
68
views
Azure React WebApp Showing PKCE issue
Getting issue PKCE(Proof Key for Code Exchange is required for cross-origin authorization code redemption.)
I have react webApp deployed on Azure WebApp , the platform there is SPA
I added the ...
0
votes
1
answer
139
views
Facing 401 error while calling an api in react js with MSAL setup
I am trying to use MSAL library by Microsoft in my react js project. We have done the app registration for both front-end(react js) and backend(api). Currently, I am testing this in my local machine ...
0
votes
1
answer
54
views
MS Entra ID redirect URL for Excel Addin
I am developing an Excel Addin that uses the MSAL to perform SSO on behalf of the logged in user. Given that the user is running the Addin from O365 cloud they are already signed into the domain, and ...
0
votes
1
answer
112
views
How do I use MSAL-react to get the oid of any user?
I'm new to MSAL and working on an Office js react add-in, which will be free to download and use with 'basic' features and require a subscription for 'pro' features. The subscription-purchase workflow ...
1
vote
0
answers
22
views
msal-browser with a non-Microsoft identity provider is refreshing tokens every time acquireTokenSilent called
I am trying to set up the MSAL browser library to work with a instance of Duende Identity Server. Login is working fine so I'm able to obtain an initial set of tokens. I'm now trying to use ...
0
votes
0
answers
235
views
BrowserAuthError: popup_window_error: Error opening popup window on @azure/msal-browser 2.16.1
I have the following situation:
Package: @azure/msal-browser 2.16.1
Code:
try {
authResult = await installerMsal.loginPopup({
scopes: ...,
prompt: 'consent'
});
} catch (err) {
...
This ...
0
votes
0
answers
92
views
Azure angular msal/browser package is opening blank popup when trying to log into teams
I am using Angular 12. This uses "@azure/msal-angular": "^2.0.0" and "@azure/msal-browser": "^2.14.2" packages. This has been working fine for the last 2 years. ...
0
votes
1
answer
93
views
TypeError: request.deviceCodeCallback is not a function when using MSAL Node
I'm encountering an issue with the MSAL Node library where I'm getting a TypeError regarding request.deviceCodeCallback not being a function. Here are the details:
Relevant Code:
I'm using the ...
1
vote
0
answers
39
views
How to build a library that can be used in various types of applications (executables, web, etc.) using msal-node?
I'm developing a library for authentication using @azure/msal-node, however, for each type of application, there is a specific class. For instance, ConfidentialClientApps for web app, web API, service/...
1
vote
0
answers
153
views
When logging in with MsalAuthenticationTemplate and it redirects me to my website, it gives a rendering error
When i go to my site it redirects me to the external login and i perform a login. Good so far, but then it redirects me to my site and i get the errors.
The two errors i get:
Warning: Cannot update a ...
0
votes
0
answers
39
views
Ionic React Android, unable to get access token after redirect
I'm using @ to get access token from azure ad b2c but I'm facing issues in android. in android it's showing error that Unable to complete authorization as there is no interactive call in progress. ...
0
votes
1
answer
77
views
OUTLOOK: MAC: Add-in using MSAL/GraphAPI, Refresh token for ssoSilent fails
Have an Outlook add-in that uses the dialog API to prompt the user via MSAL-JS for Graph API access. It works in Safari on Mac, Edge on Mac, Chrome on Mac, FF on Mac, and 100% from any Windows client ...
0
votes
1
answer
92
views
Encounter CROS error while trying to get key vault secrets in my Angular app(using Msal.js)
I am trying to get key vault secrets in my Azure account. I am using Msal.js for that. I can successfully log in to my app with azure but while I am trying to get secret. Here is my function to get ...
0
votes
0
answers
454
views
Properly secure a Vue 3 SPA with MSAL browser and Vue router navigation guards
I am trying to secure a Vue.js SPA using msal-browser redirect flow and vue router navigation guards. My solution is highly inspired by this sample from Microsoft's Github.
What I am trying to achieve:...
0
votes
1
answer
187
views
Getting Application roles in JWT token for external users and Microsoft internal users after the Authentication
We are trying to implement Role based Authentication for our Multitenant application which allows home tenant users and External tenant users as well.
Application is hosted on One tenant of Azure ...
1
vote
0
answers
99
views
MSAL js, Does extraScopesToConsent function properly during the loginRedirect workflow?
I am using the @azure/msal-browser library v3.9.0.
I am attempting to follow the MSAL docs guide for granting consent to multiple api resource scopes during the Login Redirect workflow:
https://github....
0
votes
0
answers
77
views
MSAL authentication in Angular Logout redirect problem
Working on angular app with MSAL authentication and configured it with MSAL config factory and implemented in providers of the app module. I have provided a post logout redirect uri in the ...
0
votes
0
answers
90
views
AADB2C90085 error every time user is redirected to applicaiton
We are using custom policies for user flow for our app. Every time when user completes the flow, they are redirected back to /setting page from where the policy was actually triggered. However, every ...
0
votes
0
answers
86
views
msal-browser failed in Office Addin Dialog API
I am trying to use @azure/msal-browser and @azure/msal-react to enable Excel addin support microsoft sso and access Graph api.
Due to that Excel addin does not support access external url from Excel ...
0
votes
0
answers
31
views
Promise problems in Javascript and msal.js in getting query information asynchronously [duplicate]
first of all, I apologize if I make a mistake, I am learning to use msal.js and I am in a dilemma regarding the acquisition of information with the query, I attach my source code.
const Test009 = ...
0
votes
0
answers
239
views
Login with redirect with MSAL and Vue - redirect unsuccessful
I'm trying to implement a login with redirect flow in my application using msal-browser 3.5.0, Vue 3 and TypeScript. While I don't think that this is a really niche requirement I can't seem to find a ...
0
votes
0
answers
43
views
Using MSAL, on directory's instead of subdomains
Running into an issue where we have 2 web applications (Angular) www.example.com/app1 and www.example.com/app2 and becouse they are on the same origin domain when Microsofts MSAL generates tokens it ...
0
votes
0
answers
141
views
When using Azure AD as an Identity Provider in Azure AD B2C, idp_access_token returned after signin causes error when passed to acquireTokenOnBehalfOf
Environment:
Node.js
"@azure/msal-node": "^2.6.0"
Short Version:
When calling this:
const response = await confidential_client_application.acquireTokenOnBehalfOf(...
3
votes
0
answers
287
views
Unable to run react jest test cases azure msal
I am working on react app, integrated msal library for azure authentications. I am trying to setup jest in project to run test cases. But i am getting error while running tests.
export { MsalConsumer,...
0
votes
0
answers
95
views
In my Mern stack project and I'm signing users with microsoft account in the tenant as well as with personal account but unable to call the graph api
I'm using @azure/msal-node package for my node js backend for signing in users and getting an access token for calling the m365 graph api. It works for the user inside our tenant but not for personal ...
0
votes
0
answers
78
views
Chrome Web Extension Background Authentication
I am building a Chrome Web Extension that uses '@azure/msal-browser' to authenticate users into the app ultisiing chrome.identity and Microsoft oAuth authentication.
When a user opens the extension it ...
0
votes
0
answers
59
views
Microsoft sso login is not logging in the user neither getting details about the account
This is my react app which handles sso login using a subdomain and fetches configuration dynamically. This is my code for a hook which fetches configuration dynamically from database.
import { ...
1
vote
1
answer
321
views
Are multiple App Registrations on Azure for SPA and web API necessary?
Are multiple App Registrations on Azure for SPA and web API necessary? I am making a SPA and API server by following this sample.
Here, I had to register multiple applications on Azure. Can this be ...
0
votes
0
answers
60
views
How to retrieve last user log in with MSAL
I am trying to get when the user's last log in with MSAL.
So for example if a user was last logged in say 12/12/23 11:22, when a user logs back in a week later, it will show there last log in (session)...
0
votes
2
answers
427
views
How to integrate MSAL library from scratch with Angular js 1.x application
We build our application based on AngularJS v1.8.2 and Java as a backend. Currently we have used keyclock for MFA. We have implemented everything from the backend.
Now we have to replace keycloak with ...
0
votes
1
answer
238
views
Getting Type 'InteractionStatus' is not assignable to type '"startup"' using node-browser and typescript
I was using node-browser 2.5 with javascript/typescript, based on this vue sample project.
https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/vue3-...
0
votes
1
answer
375
views
How to use Microsoft Identity platform to login users on frontend and create users on backend
I'm creating an application for a company. Every user is going to exist within AzureAD, so I'm going to authenticate with Microsoft for these users to login to the app.
This is my current logic flow:
...
0
votes
1
answer
223
views
Why app react don't work in server dev? Using msal-react
My page authentication works perfectly in localhost, but in the dev server the page is blank and in the console: Error in server dev: The above error occurred in the MsalProvider component.
Help me, ...
0
votes
0
answers
101
views
msal://redirect not working in custom app
I am creating a electron based app where I ask the user to login to microsoft. When logging in I get the error of Failed to load URL; msal://redirect with error: ERR_FILE_NOT_FOUND. I tried the ...
0
votes
0
answers
111
views
msalIns.loginRedirect redirect to login page many times after login successfully
as pic showed above, when I signin, my auth page be redirected many times
this auth page is just a transition page to show login status
import { useEffect, useState } from 'react'
import { useMsal, ...
1
vote
1
answer
145
views
MSAL.js and Axios - aquireTokenPopup interaction in progress
We're using axios request interceptors to aquire access token from MSAL.js and add it as a bearer token to all API requests to our backend:
const acquireToken = async () => {
const accounts = ...
0
votes
0
answers
73
views
Front channel URL not being called for Angular 15 MSAL.js v3 when end session endpoint called
I am having a problem with my front channel url being called from logout. It works in edge, but not in chrome. We have several applications that this works for. The only one that is not logging out ...
0
votes
0
answers
319
views
Existence of redeem refresh token journey in B2C custom policy causes bad request 400 response from token request coming from MSAL.js
I have Angular app which authenticates users in Azure AD B2C using MSAL library with standard usage of that library. I have separate custom policy for sign-in which worked fine so far. I don't have ...
0
votes
0
answers
195
views
Microsoft Teams React-App SSO not working on iOS mobile
I am creating a react app for teams. Using the teams-toolkit i added SSO as instructed in their doku. Everything works fine, i can login users and get accessTokens to call my secured BE. But for some ...
0
votes
1
answer
299
views
Unable to authenticate against azure fhir api from msal-react
I am trying to access the azure api for fhir from a react application. I am using msal-react 2.x. I get a 401 error when I try to access the "/Patient" rest endpoint. I have created a Azure ...
0
votes
1
answer
663
views
Cannot close popup login MSAL with React
im trying to login using MSAL with react.
I make code for recover the token generated by MSAL (for later use it with fetch methods); in the process i use the method loginPopup() for open a popup where ...