You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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