Add claims locally, resign token - .NET6 Blazor WASM Hosted

Before I sink time into this, I would like to confirm a workflow is reasonably possible and has no glaring oversights…

I want to add locally stored claims to a JWT, resign it, and return it to the client. The client would then use that JWT in the Authorization header on all future http requests.

The workflow would look like this:

  1. User logs in via Okta in Blazor client SPA – working!
  2. OnLoginSucceeded, SPA makes GET to backend server with Authorization header set to access_token provided by Okta – working!
  3. Server decodes JWT via Okta and populates httpcontext – working!
  4. Server adds locally stored claims to token – not implemented
  5. Server resigns token and responds to client with new token – will this work?
  6. Client SPA uses that new token in Authorization header for all future requests – will this work?

This implementation will be on .NET 6 Blazor WASM Hosted.


Disregard. This is superfluous. I’ll just pass the local claims back to the client in json from an [Authorize] endpoint then validate future requests from the client on the server side.