Duende.AccessTokenManagement.OpenIdConnect + Entra ID + Multiple APIs #370
Replies: 2 comments 9 replies
-
|
This might be a duplicate of https://github.com/orgs/DuendeSoftware/discussions/279. In short, when your users need to access multiple scopes across different resources, you will need to request the initial access token for all resources / scopes. Then, for each of the named HTTP clients, you downscope to the scopes/resource needed for that specific API. |
Beta Was this translation helpful? Give feedback.
-
|
I understand but getting this done is confusing and there are no code samples available. Working with entra id will issue access token with graph audience and scope only. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to use the OIDC token management package, in the examples it looks pretty simple and straightforward, but I can't get it to properly work for me.
I am using Entra ID as IDP and my backend (bff) is forwarding calls to both Microsoft Graph and a custom api service.
As I understand this is the expected behavior as Entra ID will not issues access tokens with multiple audiences.
I thought to configure the token management middleware with two named http clients, each with it's own scopes but I see both clients simply ignore the custom parameters and use the initial access token issued by the initial login.
What am I missing?
Here is how I register the named HTTP clients:
The custom API HTTP client is registered the same way with custom scopes.
The behavior I get is that because the access token issued by Entra ID contains only graph scopes all graph calls work as expected but the custom API calls all end with 401 response.
What am I missing?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions