Skip to content

[question] Adding to jwt claim  #194

@acidtonic

Description

@acidtonic

I'm using the library and it's working great. I'm using it for simple authentication and I have no issues there. However I am curious about adding more claims to an existing token.

I have a login facility, but I am looking into adding a second "environment" pivot and I don't want to tie the environment to the login of the user, but rather allow the user to add/remove claims to the token which effects their environment without logging in and out to change it.

So after I create the token for login, can I keep the existing token and simply append a new claim for environment and sign again? Or should I throw away the first token and give them a new one with everything added? Or should I keep it separate and return a different token for the environment claim and then deal with the user having to send more than one token which seems wrong?

I was looking for a way to add a claim to an existing token, is that possible? I believe the right answer is to just send a new token with all the claims but figured I'd ask if I am understanding this correctly.

Appreciate the work. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions