Skip to content

How do you create a Claim with a Map? #163

@rgibanez

Description

@rgibanez

I'm trying to create a Claim which will be called 'custom' and will be a collection of key/value pairs.

Example:

"user_id": "123456", "custom": { "first_name": "John", "last_name": "Smith" }

I can create the Claim: user_id, but am unsure of the best way to add the Claim which is a collection.

String token = JWT.create().withClaim("user_id", "123456").sign(algorithm);

Any advise would be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions