prime-reportstream icon indicating copy to clipboard operation
prime-reportstream copied to clipboard

Create JWT read/write service in shared project

Open jalbinson opened this issue 1 year ago • 0 comments

User Story

I want to pass along JWT data in a custom header from a microservice to any other microservice and use the same code to read/write it.

Description/Use Case

I want to pass application group data from the auth microservice to both submissions and report stream services. I don't want to have to re-write any of the read/write code.

Risks/Impacts/Considerations

Updates to the shared project can affect all underlying services. Tread carefully.

Dev Notes

  • Create new public/private keypair using RS256 algorithm
    • instructions
    • Save the Base64 encoded private key up in azure
  • Make a new JWT service that can read and write generic data classes from JWTs
  • Make a new data class that will be the structure for our application groups JWT
    • Include the common JWT claims (sub, expiration, etc)
    • Include a custom claim for groups as an array of strings
  • The read/write functions should accept the private or public key as a parameter to each service will pass in what it needs

Acceptance Criteria

  • New service lives in shared project
  • Can read/write JWTs given keys
  • can serialize/deserialize to data classes
  • unit tests

jalbinson avatar Oct 08 '24 15:10 jalbinson