-
Notifications
You must be signed in to change notification settings - Fork 68
Add support private key jwt authentication #1254
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
Add support private key jwt authentication #1254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- need review again after test and doc added.
- Pr checks failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for Private Key JWT Authentication to the Auth0 CLI. Key changes include:
- Introducing new flags for client assertion signing algorithm and private key path.
- Updating negative tests to validate the new authentication requirements.
- Adding new functions to support JWT-based machine login in both the CLI and authentication layers.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/cli/login_test.go | Updated tests for new error messages covering various flag combinations. |
| internal/cli/login.go | Added new flags and implemented JWT machine login along with refactoring for clarity. |
| internal/auth/auth.go | Introduced functions to generate and sign JWT assertions for client authentication. |
| go.mod | Updated dependencies and added required packages for JWT support. |
| docs/auth0_login.md | Updated documentation to include new flags for Private Key JWT authentication. |
| err := cmd.Execute() | ||
| assert.EqualError(t, err, "for machine login, provide domain with either (client-id, client-secret) or (client-id, client-assertion-signing-alg, client-assertion-private-key)") | ||
| }) | ||
| t.Run("Negative Test: it returns an error when only client-assertion-private-key, domain passed together", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to add a new test for, direct content when authenticating via Private key(sample)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
nit: add example on PR description. |
🔧 Changes
Add support for Private Key JWT Authentication. Now users can login via:
auth0 login --domain <domain> --client-id <client-id> --client-assertion-private-key <path-to-private-key / private-key> --client-assertion-signing-alg <signing-algorithm>📚 References
Private Key JWT authentication support
🔬 Testing
📝 Checklist