-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
JWT verification fails with audience claim #955
Comments
Can you provide more information please, such as the http request and error message? |
@begriffs I accidentally tabbed and hit return and the form posted before I had a chance to finish typing. I've edited it now. |
Oh man that sounds bad, so if |
Not at all, it just fails with a So a solution is to either disable this check or to instruct the jose library what the audience to check should be, through the postgrest configuration file. |
^^ So,
That sounds like it wouldn't break anything for existing deployments. |
Yeah sounds straightforward. I'll open a PR to implement this. |
I've managed to configure postgrest 0.4.3 with a JWK retrieved from keycloak, and specify a custom mapper in keycloak so that I can force a "role" claim to be included in the JWT to satisfy postgrest. However, I'm now running into the error JWTNotInAudience from postgrest. I have not been able to find any way to configure keycloak to leave the "aud" claim out of the JWT, so I think the workaround for Auth0 isn't viable for keycloak. I'm pretty newbie to haskell but interested in helping with this if the PR is not already written as I have already invested a bunch of time figuring out keycloak and this seems to be the last missing piece to get postgrest working with keycloak. |
Signed-off-by: Elliot Murphy <[email protected]>
Signed-off-by: Elliot Murphy <[email protected]>
@statik this is great, I have the same issue, can I update Postgrest with your work? |
@marsouin this was just merged to master an hour ago, I am currently running with a version I built from source until the next release comes out and it's working ok for me. |
Oh awesome! Any tips on building it? I'm very new to Haskell... |
@marsouin The build instructions cover this. |
I've created a pull request in the docs for this (PostgREST/postgrest-docs#106) so closing this now. |
In the jose library if the
aud
claim is present in the JWT then during verification it validates this claim.Currently, there is no way to disable this or set the audience claim so verification is unsuccessful. Specifically, the
JWTNotInAudience
message is generated during JWT verification.The text was updated successfully, but these errors were encountered: