I'm using Blazor Server with Strawberry Shake 15.1.10.0 to consume a GraphQL API.
Here's the flow:
User logs in via a regular API call (SignInAsync(username, password))
The API returns a JWT token (accessCode)
I need this token to be sent as:
Authorization: Bearer <token>in all subsequent GraphQL requests made by the IClient (Strawberry Shake)
After login, I call a query like
UserDetailsQueryto fetch user data before marking the user as authenticated
Problem:ITemporaryTokenStore (scoped) set in login page → never reaches AuthHandler.
I've already tried:
HttpContext.RequestServicesCreateScope()ConfigureHttpClient(sp, ...)
All return null. Only works with a singleton → unsafe for multiple users.
Question: how to securely pass the token to Strawberry Shake before authentication, using scoped services and supporting multiple users?