Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ramya18101
Copy link
Contributor

@ramya18101 ramya18101 commented Jun 18, 2025

🔧 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

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

Copy link
Contributor

@kushalshit27 kushalshit27 left a 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

@kushalshit27 kushalshit27 requested a review from Copilot June 18, 2025 12:06
Copy link

Copilot AI left a 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.

@ramya18101 ramya18101 marked this pull request as ready for review June 23, 2025 03:53
@ramya18101 ramya18101 requested a review from a team as a code owner June 23, 2025 03:53
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) {
Copy link
Contributor

@kushalshit27 kushalshit27 Jun 25, 2025

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)

Copy link
Contributor

@kushalshit27 kushalshit27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kushalshit27
Copy link
Contributor

nit: add example on PR description.

@ramya18101 ramya18101 merged commit 7b8ee96 into main Jun 30, 2025
12 of 13 checks passed
@ramya18101 ramya18101 deleted the DXCDT-1073-add-support-private-key-jwt-authentication branch June 30, 2025 07:21
@ramya18101 ramya18101 mentioned this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants