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

Include claims into the JWT #161

Open
svituz opened this issue Sep 11, 2024 · 1 comment
Open

Include claims into the JWT #161

svituz opened this issue Sep 11, 2024 · 1 comment

Comments

@svituz
Copy link

svituz commented Sep 11, 2024

Hi,
is it possible to include claims directly in the JWT.
I have a list of claims for users:

  [{
    "SubjectId": "user-id",
    "Username": "user",
    "Password": "password",
    "Claims": [
      {
        "Type": "given_name",
        "Value": "User",
        "ValueType": "string"
      },
      {
        "Type": "preferred_username",
        "Value": "[email protected]",
        "ValueType": "string"
      },
      {
        "Type": "email",
        "Value": "[email protected]",
        "ValueType": "string"
      }
    ]

I'd like to configure the server so that the claims are in the JWT when I decode it. Is it possible to do that?

@Matthew-Davey
Copy link

What you have written is correct, but you also must remember to configure the scopes (API_SCOPES_INLINE or API_SCOPES_PATH)

Given your user configuration...

[
    {
        "Name": "my-api-scope",
        "UserClaims": ["given_name", "preferred_username", "email"]
    },
    {
        "Name": "my-other-api-scope",
        "UserClaims": ["email"]
]

This instructs which claims to copy into the JWT, depending on which scope is being used.

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

2 participants