-
Notifications
You must be signed in to change notification settings - Fork 218
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: support both certs and raw public keys #6601
Comments
@achamayou, one design question so far, shall we
Self-endorsed cert looks, as we may set expiry date explicitly, however, it may look a little weird. On the other hand, it's a smaller change, no schema changes involved. |
Talked on-site. Decided to move on with extending
This avoids breaking old entries format and simplifies transition to the new code version. |
Wondering which key types to support in here. Checked Google's and Facebook's well-knows configs, both use RSA256 keys. @PallabPaul do you have a list of providers you intend to support? At least those which you think may be a must-have, just to double-check the key types. |
So the overall goal would be to support the same IdP's that other Azure services like Azure Function supports listed here and also allow customers to add their custom IdP as long as they follow the OIDC protocol: From this list it looks like Apple also follows RSA256 but couldn't find the well-known endpoint for Github or Twitter. IMO, RSA256 keys should suffice and open up many common IdP's that we can support. We have also started exploring alternatives such as inviting external IdP's to Microsoft Entra Id which would allow the external user to be part of AAD and have a JWT token provided by Microsoft which includes the |
That's a useful one, thank you! |
When testing against the existing implementation, I found out we're unable to verify signature produced by python jwt package.
Recently the RSA sign/verify has been altered (#6405) to use a more up-to-date default padding, so verification code now looks like this
However, the tokens signed by the current python jwt library seem to use different padding, because changing The OpenID spec says it's recommended to use I plan to proceed in the following way
|
Noticed that cert verification worked, but raw keys didn't, wondered why. Revealed that we always used EC-specific code ( It worked because of the implementation similarity, and because we specified Created #6673 to tidy-up the interfaces, meanwhile will try to sort out the paddings supported. |
Carefully read the RFC, so the important quote from section 8 is:
I checked the .well-known Entra config:
As per JWA spec:
Also checked Facebook's and Google's endpoints, all use |
@maxtropets we have to continue to support it at least on the validation path then, which also means that test code must be able to emit it unfortunately. |
Tried FB token authentication, noticed a problem with We now require it as mandatory, Entra seems to always provide it: https://learn.microsoft.com/en-us/entra/identity-platform/access-token-claims-reference. However, other providers don't seem to. Suggested solution: I'll make this claim optional to allow working with 3rd-party providers. |
https://www.rfc-editor.org/rfc/rfc7518.txt
|
For instance, FB openid conf:
https://www.facebook.com/.well-known/oauth/openid/jwks/
Format:
CCF now only supports
x5c
field though. It has to support bothx5c
andn + e
combination.n
+e
fieldsjwt_management.h
OpenSSL_Verifier
only supports certs)jwt_auth.cpp
, fallback to cert if needed (used public keys in the KV only, extracting ones from the certs on a fly when settingThe text was updated successfully, but these errors were encountered: