Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub field #3

Open
ym-corey opened this issue Jun 13, 2024 · 2 comments
Open

sub field #3

ym-corey opened this issue Jun 13, 2024 · 2 comments

Comments

@ym-corey
Copy link

In JWT spec and this doc, the sub field is a string. In the provided example, the sub field is a nested json object. Is the idea that this will be a stringified json?

Should this instead be additional claims at the top layer of the JWT obj?

@jaredmoscow
Copy link
Collaborator

@ym-corey it seems like there are two options for this.

  1. Stringify the JSON object: this structured data could store as a JSON string within sub
    example: "{"identifierValue":"28f6dc889e...fe167","identifierType":"email","identifierFormat":"sha256"}"

  2. Use Additional Claims at the Top Level: Instead of embedding structured data within sub, move the relevant fields to separate claims in the JWT payload.
    example:
    "sub": "28f6dc889e...fe167",
    "identifierType": "email",
    "identifierFormat": "sha256"

in this sub probably assumes the role of the current identifier value field? if that is the case, we'd be introducing a breaking change due to claim and payload restructuring.

is there a preferred method?

@lpolya-tl
Copy link

@ym-corey @jaredmoscow I would suggest the best way forward is option 1 since it already exists in the spec and I don't believe it goes against the JWT guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants