RemoteJWKSets should follow 301 redirects #240
Replies: 1 comment 2 replies
-
I've not had any redirection following allowed in Facebook's discovery mechanism in itself is not conform because it redirects in the first place. If the issuer identifier is https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse
I am aware that is for the discovery document itself, not the jwks_uri specifically, so, can you find a normative language or a WG discussion stating that HTTP 3xx Status Code responses with a |
Beta Was this translation helpful? Give feedback.
-
I'm getting the jwks url from the OpenID configuration file from facebook (https://www.facebook.com/.well-known/openid-configuration) which has "https://facebook.com/.well-known/oauth/openid/jwks/" set as value for
jwks_uri
. however this url 301 redirects to thewww.
subdomain, causing jose to throw an error:JOSEError: Expected 200 OK from the JSON Web Key Set HTTP response
.There's a couple of things I can do:
jwks_uri
to includewww.
though I don't think Facebook is actually violating any spec here, and a related issue ended up not getting fixed either (https://developers.facebook.com/support/bugs/347371913710660/) so I don't think this will end up getting changed.https://www.facebook.com/.well-known/oauth/openid/jwks/
, but this makes it less future-proof and makes it more difficult to add new supported issuers.Currently redirects are explicitly disabled at:
jose/src/runtime/browser/fetch_jwks.ts
Line 14 in 88eee00
Is there a reason for this?
The nodejs version of fetch_jwks.ts requires a bit more work to support redirects but should still be straight forward if you're willing to turn it into a recursive function.
Beta Was this translation helpful? Give feedback.
All reactions