-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Support JWTs signed with ECDSA (ES256
, etc.)
#15181
Comments
Does the Kanadim provides a jwt with the fields and values required by jitsi-meet? |
Kanidm's OAuth 2.0 access tokens are RFC 9068 JWTs – so any service can introspect the tokens it issues directly, and check their validity against its certificates (distributed with JWKS). But I haven't tested that far yet. 😄
On further inspection, it looks like I suspect that in an ideal world, if an OIDC IdP provides RFC 9068 JWTs and there is some way to provide the IdP's public keys to Jitsi, an "adapter" for such an IdP shouldn't need to do much crypto or hold (m)any secrets at all – just complete a PKCE challenge (generate a random value and stash it somewhere, and SHA256 the value for the authorisation code request). There's be nothing precluding that kind of flow from happening with either RSA or ECDSA – but it would mean that both the IdP and Jitsi would need to support the same algorithms. |
Yep, but we require some special values, the token produced needs to look like this: |
Ah, right... so the problem is more difficult then. While this is getting pretty far from the original request for ECDSA, I think Jitsi is using that in a non-standard/incorrect way too, comparing Jitsi token structure with RFC 7519:
While RFC 7519 allows for arbitrary other claims, Jitsi's As a side note, allowing While I see there was a goal was to remove a lot of authentication logic from Jitsi's core, the way it uses JWTs is incompatible with everything, and that's leading to insecure adapters. I'd much rather put this through an IdP which can implement standard OAuth 2.0 / OIDC flows securely, and have Jitsi consume them directly. |
Ah, I see there's a |
This is an excellent and in-depth analysis of the circumstances, thank you very much for laying all this out. I am primarily responsible for the situation as it is today, due to poorly understanding the RFC combined with my intention to solve an internal problem for the team without properly considering possible external uses. I have been considering ways to improve the situation to be more compatible with external identity providers, but haven't completed any full thoughts on the matter. All of this discussion probably deserves a topic on community.jitsi.org, so I suggest we move it there. |
No worries, I recognise this is a difficult problem space with complex requirements, and that cipher support is just one small step towards achieving my goal. I'm still researching things to get a better understanding where everything is at, so I'll follow up there when I'm ready. |
What problem are you trying to solve?
I'm trying to authenticate Jitsi users with Kanidm.
It looks like
jitsi-keycloak-adapter
would bridge the gap between Kanidm providing a JWT with OIDC, and then Jitsi authenticating the user with a JWT in a query parameter.It looks like the actual verification of the token is done by Jitsi Meet.
Its utility functions support
HS256
,HS384
,HS512
,RS256
,RS384
andRS512
algorithms, with a Prosody plugin:jitsi-meet/resources/prosody-plugins/luajwtjitsi.lib.lua
Lines 38 to 54 in 3438e5d
The plugin can also fetch a public key from a keyserver, but this only supports RSA:
jitsi-meet/resources/prosody-plugins/token/util.lib.lua
Lines 281 to 283 in 3438e5d
However, Kanidm's default OAuth2 configuration provides a JWT signed with
ES256
, which Jitsi Meet does not support.What solution would you like to see?
Jitsi Meet should be able to verify a JWT signed with ECDSA/
ES256
, in addition to existing algorithms.Support for
ES256
is recommended "plus" in RFC 7518 section 3.1, where "plus" indicates that the requirement strength is likely to be increased in a future version of the specification.RFC 7518 was published in 2015, so the recommendation is more than a little dated. 😄
Is there an alternative?
Kanidm can be configured to support RSA, but it considers it to be a legacy algorithm because RSA requires significantly longer keys to provide equivalent security to ECDSA.
The text was updated successfully, but these errors were encountered: