Closed ChristianWeyer closed 4 years ago
I just changed my application to only use OidcHttpClient with DI in my service. Actually, this does not seem to work at all when I use OidcHttpClient in my own custom service via DI. The token is not picked up.
One more update :-) It works when I register my custom service as scoped in DI. I had it as singleton originally.
Yes, singleton services and scoped dependencies are an explosive mix: I've been burned by it too! :smile:
😅🔥
When using OidcHttpClient in a Blazor page like /conferences directly in the .razor file everything seems fine.
When I add another page for e.g. /conference/{id} which then, in turn, uses a custom service which then uses OidcHttpClient (all via DI), then this instance of OidcHttpClient does not pick up the token when doing API calls.