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

aws Cognito JWT Token claim 'cognito:groups' tranform to claim 'groups' #105

Closed
aerodc opened this issue Jul 15, 2019 · 7 comments
Closed

Comments

@aerodc
Copy link

aerodc commented Jul 15, 2019

Hello Guys,

Do you know how to tell smallrye-jwt to use claim 'cognito:groups' as standard claim 'groups'?

Thanks a lot

@sberyozkin
Copy link
Contributor

sberyozkin commented Jul 15, 2019

@aerodc Can you type a sample JWT JSON please ?

@aerodc
Copy link
Author

aerodc commented Jul 15, 2019

@sberyozkin thanks for your quick response,
the sample JWT Json is aws cognito jwt token like:

{
  "sub": "bbbbbbbb",
  "aud": "xxxxx",
  "cognito:groups": [
    "group1"
  ],
  "email_verified": true,
  "event_id": "ccccccccc",
  "token_use": "id",
  "auth_time": 1563193576,
  "iss": "https://cognito-idp.eu-central-1.amazonaws.com/eu-central-CCCCC",
  "cognito:username": "tester",
  "exp": 12233444,
  "iat": 12233444,
  "email": "test@gmail.com"
}

@sberyozkin
Copy link
Contributor

@aerodc sure see this property. Can you confirm it works please ?

@aerodc
Copy link
Author

aerodc commented Jul 15, 2019

@sberyozkin
should I put it like this?

smallrye.jwt.path.groups=payload/'cognito:groups'

but I got errors message

No claim exists at the path payload/'cognito:groups' at segment payload
Claim value at the path payload/'cognito:groups' is not an array

@sberyozkin
Copy link
Contributor

sberyozkin commented Jul 15, 2019

@aerodc just

smallrye.jwt.path.groups=cognito:groups

@aerodc
Copy link
Author

aerodc commented Jul 15, 2019

@sberyozkin thanks a lot and it works!

@sberyozkin
Copy link
Contributor

@aerodc np, thanks for your question. Please consider asking at the Smallrye forum or at the Quarkus/Thorntail lists if you work with either of these projects

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