-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Hasura fails to load standards compliant JWKS with unrecognized “use” values. #10733
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
Comments
Hi @JesperWe I have passed on to the team. In the meantime can you supply a secret-redacted JWT from the server for us to have a look at? |
Sure. Here is an example. Just pointing out that it is the JWKS we are talking about, not the JWT. {
"keys": [
{
"use": "sig",
"kty": "RSA",
"kid": "321693135832881917",
"alg": "RS256",
"n": "...",
"e": "AQAB"
},
{
"use": "sig",
"kty": "RSA",
"kid": "321728951783267069",
"alg": "RS256",
"n": "...",
"e": "AQAB"
},
{
"use": "sig",
"kty": "RSA",
"kid": "321766531002276605",
"alg": "RS256",
"n": "...",
"e": "AQAB"
},
{
"use": "sig",
"kty": "RSA",
"kid": "321802769537178365",
"alg": "RS256",
"n": "4...",
"e": "AQAB"
},
{
"use": "saml_ca",
"kty": "RSA",
"kid": "321336129393530431",
"n": "...",
"e": "AQAB"
},
{
"use": "saml_response_sig",
"kty": "RSA",
"kid": "321336135382996543",
"n": "...",
"e": "AQAB"
},
{
"use": "sig",
"kty": "RSA",
"kid": "321838209426266877",
"alg": "RS256",
"n": "...",
"e": "AQAB"
}
]
} |
Hi @JesperWe Mostly ✔️—but two details break strict RFC 7517 complianceWhat is valid
What needs attention
(Minor: the placeholder "n": "..."/"4..." obviously must be a real Base64URL-encoded modulus.) Bottom line
So: change or drop the non-standard use values and you have a fully standards-compliant JWKS. |
That is just plain wrong. Check the specs: https://www.rfc-editor.org/rfc/rfc7517.html#section-4.2 "Other values MAY be used" So a file using other values is still strictly according to the spec. |
To be clear do you mean skip over any JWKs in the keys array that we can't parse? If so that seems doable, we would probably need to issue a warning in that case. Or are you trying to use those keys in hasura? |
No, not expecting to use those keys in Hasura. Hasura only needs keys to verify publicly signed JWTs. But I am expecting Hasura to peacefully (as in not throwing errors) coexist with other tools in a larger system where the Identity Provider offers multiple auth types and thus keys used for in this case SAML. |
Uh oh!
There was an error while loading. Please reload this page.
Version Information
Server Version: 2.48.1
Environment
OSS
What is the current behaviour?
When starting up and loading a JWKS specified by the
HASURA_GRAPHQL_JWT_SECRET
jwk_url
Hasura will fail to initialise with the error message...if the returned JWKS has
keys[].use
value not equal tosig
orenc
.While those two values are named in the RFC Section 4.2, it also says:
However Hasura does not accept a JWKS with a key whose
use
value is not equal tosig
orenc
.What is the expected behaviour?
Unrecognized values should simply be ignored.
How to reproduce the issue?
Point the
HASURA_GRAPHQL_JWT_SECRET
jwks_url
to a JWKS withkeys[].use
values containing for example "saml_ca" (Typically used fot an IdP with SAML support)Keywords
auth jwks
The text was updated successfully, but these errors were encountered: