The Microsoft Authentication Libraries (MSAL) gives you the ability to add support for Azure Active Directory v2 (serves Microsoft Account and AAD) and B2C. Supports native clients such as Windows, iOS, OSX, Android, and Linux.
Questions tagged [azure-ad-msal]
2700 questions
12
votes
3 answers
Microsoft Graph API token validation failure
I would use Microsoft Graph API in my Angular Web application.
First I make connexion using msal library
When I try log in with my profil I get this error
I have configured my app as the mentionned in the official git sample
MsalModule.forRoot({
…

infodev
- 4,673
- 17
- 65
- 138
12
votes
1 answer
MSAL Scopes (openid profile offline_access). Basic Simple Profiles May Not be Possible?
MSAL behaves as though there is a hard-coded catch 22 at its API library layer that seems illogical when I use it.
string[] scopesArrayNonNullWORKS = new string[] { "email" };
string[] scopesArrayAlreadyThereInMsalCalls_FAILS = new string[] {…

Sql Surfer
- 1,344
- 1
- 10
- 25
11
votes
1 answer
Get-MsalToken error AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'
Here is my PowerShell script
$connectionDetails = @{
'TenantId' = '****-****'
'ClientId' = '****-****'
'Interactive' = $true
'Scopes' = '****-****'
'RedirectUri' = '****-****'
}
$token = Get-MsalToken…

blogs4t
- 2,329
- 5
- 20
- 33
11
votes
2 answers
MSAL/ADAL C++ equivalent to get access tokens
Is there a MSAL/ADAL equivalent for C++ ? I would like to natively support getting access tokens for Azure in C++ (rather than build a bridge of some kind by using python version.)
Thank you

Rags
- 139
- 1
- 4
11
votes
1 answer
MSAL for Android fails performing B2C login
I'm using 0.2.2 version of Microsoft Authentication Library (MSAL) Preview for Android library to perform Azure AD B2C login in my native Android app. The library opens the browser to start login process. Afterwards I log in successfully and it…

Ugurcan Yildirim
- 5,973
- 3
- 42
- 73
11
votes
1 answer
How to sign out from Azure AD 2.0/MSAL in a desktop application?
I'm using MSAL in a WPF desktop application that needs to allow users to sign in and out against Azure AD v2.0. Microsoft's Graph access sample and most of the other examples I see use PublicClientApplication.Remove(IUser) to log out, like in this…

Katja
- 121
- 1
- 5
10
votes
5 answers
Redirect onLoad only if not authenticated with @azure/msal-react
I'm trying to adapt the sample project for my needs.
My needs are essentially:
Automatically redirect login if the user is not authenticated when they navigate to the root route...
If they are, load the protected child components.
I have step 1.…

cjones
- 8,384
- 17
- 81
- 175
10
votes
1 answer
What is the difference between the Azure Identity and MSAL libraries for Python?
EDIT: Correct links
Dumb question, but would be great if someone could shed some light for me.
As far as I understand, MSAL (https://github.com/AzureAD/microsoft-authentication-library-for-python) and Azure Identity…

EliasVakkuri
- 101
- 1
- 4
10
votes
1 answer
Angular Azure Active Directory B2C Authentication - CORS issue
I am implementing Azure Active Directory B2C authentication in Angular. I am using msal interceptor to connect Azure AD B2C. The authentication request fails with error
Access to XMLHttpRequest at 'https://login.microsoftonline.com/...'
from…

mani
- 105
- 1
- 10
10
votes
1 answer
how to get Facebook profile picture using Azure AD B2C
I am using MSAL.js and could successfully sign-in/sign-up users in Azure AD B2C using Facebook as identity provider. The problem is that after sign-in I cannot retrieve user's profile picture.
Azure AD B2C returns an object identifier which has no…

armache
- 596
- 5
- 22
10
votes
1 answer
Use MSAL Auth token to consume Web API 2
I have an ASP.Net Web API 2 on which I implemented the following security:
https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapi-dotnet
It worked, I can't access the controllers except if I remove…

Pierre P.
- 890
- 1
- 18
- 41
9
votes
3 answers
@azure/msal-browser TypeError: this.startPerformanceMeasurement is not a function
Introduction
Because there is no build in Auth library for nuxt 3 yet, I am trying to create my own composable called useAuth.
The Problem
I am getting a startPerformanceMeasurement error when i try to call the loginRedirect or loginPopup…

Eric
- 361
- 6
- 25
9
votes
2 answers
Mocking authentication when testing MSAL React Apps
Our app is wrapped in the MSAL Authentication Template from @azure/msal-react in a standard way - key code segments are summarized below.
We would like to test app's individual components using react testing library (or something similar). Of…

savreline
- 131
- 1
- 7
9
votes
3 answers
MSAL verify token server-side
We're moving an app from "Sign-In with Google" to "Sign-In with Microsoft". It is an SPA, but queries an API for data. The client-side is all working using MSAL v2 (msal-browser.min.js), and we can sign in and out just fine.
When we send requests to…

Stephen Last
- 5,491
- 9
- 44
- 85
9
votes
3 answers
How to validate AzureAD accessToken in the backend API
I just wanted to know how can we validate the azure ad access token in a backend API in my case i.e. Django rest framework.
Consider that I have a single page app or a native app and a backend API (django rest framework) completely independen of…

Aashay Amballi
- 1,321
- 3
- 17
- 39