[Bug] "The issuer '(null)' is invalid" error when I request my API with bearer token
See original GitHub issueWhich Version of MSAL are you using ? msal.net 1.9.0
Platform asp.net core 5.0
What authentication flow has the issue?
- Desktop / Mobile
- Interactive
- Integrated Windows Auth
- Username Password
- Device code flow (browserless)
- Web App
- Authorization code
- OBO
- Daemon App
- Service to Service calls
Other? - please describe;
Is this a new or existing app? This is a new app or experiment
Repro
I have added following lines of code.
// startup.cs
services.AddMicrosoftIdentityWebApiAuthentication(Configuration, "AzureAd");
app.UseAuthentication();
// WeatherForecastController
[Authorize]
[RequiredScope("Default")]
// appsettings.json
"AzureAd": {
"Instance": "https://login.chinacloudapi.cn/",
"ClientId": "my client id",
"Domain": "my organization domain",
"TenantId": "my organization tenant id",
"Authority": "https://login.chinacloudapi.cn/my organization tenant id/"
}
Expected behavior
I checked my token on jwt.ms, it shows everything is good.
Actual behavior
I use Postman to request the API, and the API tells me issuer is null in my token.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Bearer error="invalid_token", error_description="The issuer ...
The access token is in the certificate. It is failing. The security mode is TLS/SSL which has a number of different options like...
Read more >Bearer error="invalid_token", error_description="The issuer ...
I'm trying to implement SSO for Google and Microsoft (multi-tenant) using custom policies in an SPA application using a .NET core Web API....
Read more >Consuming web api with JWT authentication console app
The api works fine with postman and swagger. ... try { //Get the JWT string token = await AuthenticateAsync(user); Debug.
Read more >Unable to authenticate Orchestrator API for accessing ...
Unable to authenticate Orchestrator API for accessing Bearer Token. Invalid credentials error for valid credentials entered.
Read more >Bearer error="invalid_token", error_description="The issuer ...
I verified a token is created to angular 6 front end from core 2.1. When I test the token in the jwt.io it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@bgavrilMS
sts.chinacloud.cn
but response showsThe issuer '(null)' is invalid
also. So I prefer to think of it as a problem in msal.net.I use
Microsoft.Identity.Web
1.25.3
and set"accessTokenAcceptedVersion": 2
Here is my codeIt works properly. My app is multitenant.