Skip to content

feat: implement Auth0 identity provider with device flow support and add tests#11

Merged
jgarverick merged 15 commits into
mainfrom
feat/auth0
May 16, 2026
Merged

feat: implement Auth0 identity provider with device flow support and add tests#11
jgarverick merged 15 commits into
mainfrom
feat/auth0

Conversation

@jgarverick
Copy link
Copy Markdown
Collaborator

@jgarverick jgarverick commented May 16, 2026

This pull request adds comprehensive unit tests for both the Auth0 and Okta identity providers, significantly improving test coverage for authentication scenarios in the CLI. Additionally, it extends the Auth0Config model to support specifying an access token file, aligning its configuration options with Okta.

Improvements to authentication provider test coverage:

  • Added a new test suite Auth0IdentityProviderTests covering various scenarios for Auth0 authentication, including token source selection, claim parsing, error handling, and support for groups, roles, and scopes. (src/aria-cli/Aria.Cli.Tests/Auth0IdentityProviderTests.cs)
  • Added a new test suite OktaIdentityProviderTests covering Okta authentication scenarios, including token retrieval from environment/file, claim precedence, scope and group parsing, and error conditions. (src/aria-cli/Aria.Cli.Tests/OktaIdentityProviderTests.cs)

Configuration enhancements:

  • Extended the Auth0Config model to support an optional AccessTokenFile property, allowing tokens to be loaded from a file in addition to environment variables. (src/aria-auth-core/Models/AriaConfig.cs)

Copy link
Copy Markdown
Contributor

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

Adds a real Auth0 identity provider implementation (including device flow) and significantly expands CLI authentication test coverage, while also aligning Auth0 configuration options with Okta via an access_token_file setting.

Changes:

  • Implement Auth0 identity provider with env/file token resolution, JWT claim normalization, and device flow token acquisition.
  • Improve Okta JWT parsing error handling (invalid base64 → clearer exception).
  • Add new xUnit suites for Okta/Auth0 identity resolution behavior and update CLI docs to describe provider configuration/behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
src/aria-cli/Services/OktaIdentityProvider.cs Wraps base64 decode failures with a clearer InvalidOperationException for invalid JWT payloads.
src/aria-cli/Services/Auth0IdentityProvider.cs Implements Auth0 provider: token source resolution, device flow HTTP interactions, and JWT claim normalization.
src/aria-cli/README.md Documents available auth providers, configuration examples, and claim normalization behavior.
src/aria-cli/Aria.Cli.Tests/OktaIdentityProviderTests.cs Adds unit tests for Okta token source selection and claim parsing behavior.
src/aria-cli/Aria.Cli.Tests/Auth0IdentityProviderTests.cs Adds unit tests for Auth0 token source selection and claim parsing behavior.
src/aria-auth-core/Models/AriaConfig.cs Extends Auth0Config with optional access_token_file.

Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs Outdated
Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs Outdated
Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs Outdated
Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs
Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs Outdated
Comment thread src/aria-cli/README.md
Comment thread src/aria-cli/README.md Outdated
Comment thread src/aria-cli/README.md Outdated
Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs Outdated
Comment thread src/aria-cli/Services/Auth0IdentityProvider.cs
jgarverick and others added 6 commits May 15, 2026 21:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Josh Garverick <jgarverick@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Josh Garverick <jgarverick@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Josh Garverick <jgarverick@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Josh Garverick <jgarverick@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Josh Garverick <jgarverick@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Josh Garverick <jgarverick@github.com>
@jgarverick jgarverick merged commit a3b58ef into main May 16, 2026
2 of 4 checks passed
@jgarverick jgarverick deleted the feat/auth0 branch May 16, 2026 01:49
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.

3 participants