scala-jwt / oath

Yet another scala-jwt library which has the aim to enhance user experience.
Apache License 2.0
8 stars 1 forks source link

Registered claims being able to be placed in header or payload. #70

Open andrewrigas opened 1 year ago

andrewrigas commented 1 year ago

To be able to support JWE (payload encryption), It will be nice to have configuration added for determining the location of certain registered claims in header or in payload.

Example:

token {
  algorithm {
    name = "RS256"
    private-key-pem-path = "src/test/secrets/rsa-private.pem"
  }
  //  algorithm { 
  //    name = "HMAC256"
  //    secret = "secret" When using HMAC single secret is required for both verifier and issuer
  //  }
  encrypt {
    secret = "password"
  }
  issuer {
    registered {
      issuer-claim-in-payload = "issuer" // Added in payload
      subject-claim-in-header = "subject" // Added in header
...