Replies: 1 comment
-
Just to clarify, ITokenAcquisition is registered as Scoped service, because if you want acquire access token for user, you need a scope (Scope is bound to http request, which has a user). It seems like a bug, that Refit uses root service provider even when scope is available (e.g. injecting refit client to scoped service) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was trying to use the AuthorizationHeaderValueGetter setting to set the token for the protected endpoints because it seems to be a good pattern. Being in ASP .NET Core, the ITokenAcquisition DI service would be the preferred way to get the token if you have services protected by Identity Platform.
However, wherever the function for AuthorizationHeaderValueGetter is put, the DI services are not available, and the following error is returned.
Cannot resolve scoped service 'Microsoft.Identity.Web.ITokenAcquisition' from root provider.
The above scenario is easily fixed with a message handler instead, but I was hoping for this functionality to be more slick.
Beta Was this translation helpful? Give feedback.
All reactions