-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single middleware with custom Bearer scheme makes the API request to fail with 401 #958
Comments
@lnaie : you might want to try services.AddAuthentication("AzureADBearer")
.AddMicrosoftIdentityWebApi(
Configuration,
configSectionName: "AzureAd",
jwtBearerScheme: "AzureADBearer",
subscribeToJwtBearerMiddlewareDiagnosticsEvents: true
); We have a bug in custom schemes: #955, you might want to try out this branch: https://github.com/AzureAD/microsoft-identity-web/tree/jmprieur/multipleSchemeInvestigation, but mind you this is work in progress |
Ok.
Because right now it won't work. |
@lnaie : yes, I think this should be possible. |
I will have a look tomorrow. Thanks |
I have tried and it doesn't work. There seems to be this issues as well for 3.1.8+ : dotnet/aspnetcore#26002 |
I have created a POC for 2 auth middlewares (IDS and AzureAD): |
Included in 1.11.0 release and documentation here. |
For my work, I'm trying to use this library to setup the second authorisation middleware towards AzureAD. The first one is on Identity Server 4. Both of them uses the Bearer authentication scheme.
So I've found this library and have tried to integrate it without success.
Then I decided to make a simple project to study the library behaviour, because well documentation is not there for special cases or if it is is quite vague.
I have a repro project with one AzureAD middleware at
https://github.com/lnaie/azuread-poc
that fails to use a custom Bearer scheme, but it works nicely with the default "Bearer".I have assumed if it will work with a single custom bearer scheme, then there is a chance that it'll work in any other number and scheme combination.
I'm using the version
1.5.1
in the API project.Better logging would be great. Now it's not telling why it failed inside the auth/authz middleware with 401.
This works:
But this won't work:
Is it supposed to work with just one middleware for a custom Bearer scheme?
The text was updated successfully, but these errors were encountered: