Repository navigation
Add support for client assertion signing key authentication - #203
Conversation
| let(:domain_url) { 'https://samples.auth0.com' } | ||
| let(:client_assertion_signing_algorithm) { 'RS256' } | ||
| let(:client_assertion_signing_key) { OpenSSL::PKey::RSA.new(2048) } | ||
| let(:application) do |
There was a problem hiding this comment.
nit: The existing codebase uses OpenSSL::PKey::RSA.generate(2048) (see jwt_token_spec.rb line 10). .new(2048) works but is deprecated in newer OpenSSL versions. Use .generate for consistency.
|
Thanks for the contribution @kaczowkad this is a much-needed feature and the overall approach is solid. Apologies for the delay in reviewing this. I know this PR has been open for a while, and I appreciate your patience. I've left detailed inline feedback across the files. The main themes are:
Also, please ensure all commits are GPG-signed. Commit
See GitHub's guide on signing commits if you need help setting that up. Looking forward to the next iteration. 🙌 |
|
@arpit-jn Thank you for the feedback. I will try to have the updates later this week. |
c859896 to
902cf4c
Compare
|
Hey @kaczowkad, thanks for the updates, nearly everything from the review is addressed. Two remaining items before we can merge: 1. CI is failing on Ruby 3.0: there's one remaining Ruby 3.1+ hash shorthand at
Needs to be: 2. Commit signing: Both commits are currently unsigned. Could you squash into a single GPG-signed commit? Or let us know if you want us to take it forward. Once those are done, we're good to merge. Let me know if you need help with either. |
…tinuing to support client secret authentication. The client assertion signing key allows Private Key JWT application authentication in Auth0. The client_assertion_signing_key and client_assertion_signing_algorithm are optional parameters. Client assercition signing key will be used if a client_assertion_signing_key is privided. The client_assertion_signing_algorithm is optional. The algorithm defaults to RS256 if nil or not provided.
902cf4c to
2b5d9ec
Compare
|
Hi @arpit-jn, The two issues you highlighted have been addressed. Sorry those were missed on the previous update. Thanks for the review. |
| client_assertion_signing_key: client_assertion_signing_key, | ||
| client_assertion_signing_algorithm: client_assertion_signing_algorithm) | ||
| stub_jwt_token | ||
| stub_auth(oauth_response.merge(refresh_token:)) |
There was a problem hiding this comment.
There's one remaining Ruby 3.1+ hash shorthand at
stub_auth(oauth_response.merge(refresh_token:))
which should be
stub_auth(oauth_response.merge(refresh_token: refresh_token))
|
Sorry to use a closed issue for that but just wanted to double check something (probably not worth opening an issue about): Are the changes done here incompatible with Thanks |
Changes
The
omniauth-auth0gem only supports client secret authentication. Auth0 documentation states:Opened issue #199 on 2024-11-07 to inquire about adding support for private key JWT authentication. We created a workaround to support private key JWT authentication in our application using the
omniauth-auth0gem. Opening this PR to get feedback on adding support for private key JWT added to the gem.This PR adds two optional parameters to the config:
The current interface is preserved. Client secret authentication can be used without changing the interface.
Client secret authentication:
Client assertion signing key:
The existing code has
rubocopviolations which were not addressed because it was outside the scope of these changes. No newrubocopviolations were introduced.References
Please include relevant links supporting this change such as a:
omniauth-auth0gemTesting
Duplicated all the specs in
spec/omniauth/strategies/auth0_spec.rbfor client assertion signing key. The existing specs were scoped to 'client secret authentication'. All specs passed.Testing with Auth0 requires an application setup for private key JWT authentication. The public key must be uploaded to the application in Auth0.
Tested with ruby 3.2.2. Built the gem and client assertion signing key authentication with a Ruby on Rails application.
Checklist