Skip to content
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

DXCDT-298: Interactive login prompt (3/x) #551

Merged
merged 19 commits into from
Dec 9, 2022

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Dec 8, 2022

🔧 Changes

Implements an initial interactive prompt when executing the auth0 login command. This will help navigate the user through the decision tree of authentication types, in order to reduce confusion. This prompt is optional and can be skipped either by passing the --no-input flag (ex: auth0 login --no-input) or by passing in the client credentials through flags.

This PR also provides content updates to existing prompts too in an effort to provide more clarity and guidance around the authentication process.

The requirements this intendeds to satisfy:

  • Interactive navigation to any of the login mechanisms (user, client credentials, etc)
  • Should be expandable to other types of login mechanisms (ex: auth token)
  • Ability to "skip" to any login mechanisms using flags, ideally implicitly but otherwise explicitly
  • When possible, inferring login mechanism from flags (ex: --client-id will skip to user login)

Skipping

As User:
$ auth0 login --no-input or $auth0 login --scopes

Client Credentials:
$ auth0 login --domain <DOMAIN> --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>

Token:
$ auth0 login --token <TOKEN>

Interactive Mode

Initial Prompt

How do you want to login?
 > User
 > Machine
 > Token

User

User -> Create URL -> Open Browser -> stuff

Machine

Machine
 > What is the domain?
 > What is the client ID?
 > What is the client secret?

Token

Token
 > What is the auth token value?

📚 References

Related PRs:

🔬 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)

willvedd and others added 16 commits December 5, 2022 14:35
Usage:
  auth0 tenants <operation> [parameters...] [flags]

Available Operations:
  use         Set the active tenant
  list        List your tenants [ls]
  open        Open tenant settings page in the Auth0 Dashboard

Flags:
  -h, --help   help for tenants

Global Flags:
      --debug           Enable debug mode.
      --json            Output in json format.
      --no-color        Disable colors.
      --no-input        Disable interactivity.
      --tenant string   Specific tenant to use. (default "auth0-cli-integration-tests.us.auth0.com")

Use "auth0 tenants [command] --help" for more information about a command. into
Co-authored-by: Rita Zerrizuela <[email protected]>
Co-authored-by: Rita Zerrizuela <[email protected]>
@willvedd willvedd changed the base branch from main to DXCDT-267-more-reliable-access-token-regen December 8, 2022 20:19
internal/cli/login.go Outdated Show resolved Hide resolved
@sergiught sergiught force-pushed the DXCDT-267-more-reliable-access-token-regen branch from 09b9e5a to 4f2c5df Compare December 9, 2022 16:13
Base automatically changed from DXCDT-267-more-reliable-access-token-regen to v1 December 9, 2022 16:19
@sergiught sergiught marked this pull request as ready for review December 9, 2022 17:32
@sergiught sergiught requested a review from a team as a code owner December 9, 2022 17:32
@sergiught sergiught force-pushed the DXCDT-298-interactive-login-prompt branch from ffb3404 to cba7a28 Compare December 9, 2022 17:33
@sergiught sergiught merged commit d95248c into v1 Dec 9, 2022
@sergiught sergiught deleted the DXCDT-298-interactive-login-prompt branch December 9, 2022 17:39
willvedd added a commit that referenced this pull request Dec 21, 2022
* DXCDT-287: Remove format flag in favor of json flag (#533)

* DXCDT-288: Add perms alias for permissions subcommand (#534)

* DXCDT-286: Relegate --force flag from global context (#535)

* DXCDT-286: Hide global flags from commands when not applicable (#536)

* [1/4] DXCDT-266: Move domains subcommand one level up the hierarchy (#539)

* [2/4] DXCDT-266: Bring branding emails command under email templates (#540)

* Back-merging `main` into `v1` (#543)

DXCDT-293: Access token management for client credentials (#537)

* Storing and refreshing access token for client credentials

* Removing unnecessary comment

* Removing tenant name from being stored, removing flag declarations

* Removing tenant name from being stored

* Fixing erroneous delete

* Simplifying ExpiresAt assignment

* Remove duplicate addTenant in tenants add command

* Remove setting scopes on tenant when using client credentials

* Refactor how we check for token expiration while preparing the tenant

* Refactor cli.prepareTenant func

* Refactor cli.setup func

Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>

Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>

* [3/4] DXCDT-266: Rename branding cmd to universal-login (#541)

* [4/4] DXCDT-266: Update docs after branding command refactor (#542)

* DXCDT-283: Remove `config` command (#532)

Co-authored-by: Will Vedder <[email protected]>

* DXCDT-267: Consolidate `auth0 add tenants` into `auth0 login` (1/x) (#546)

Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>

* DXCDT-267: Graceful handling of access token regeneration (2/x) (#547)

Co-authored-by: Rita Zerrizuela <[email protected]>
Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>

* DXCDT-298: Interactive login prompt (3/x) (#551)

Co-authored-by: Rita Zerrizuela <[email protected]>
Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>

* DXCDT-295: Refactor quickstarts command to use quickstart meta URL (#553)

* DXCDT-297: Remove env var ingestion (#554)

Removing environment variable ingestion, removing unnecessary comment

Co-authored-by: Will Vedder <[email protected]>

* DXCDT-271: Add ci step to check that docs are up to date (#560)

* DXCDT-271: Move bundle install out of make docs and into docs-start (#562)

* DXCDT-296: Supporting additional scopes when authenticating as user (#561)

* Adding additional scopes support via --scopes flag

* Adding additional scopes support via --scopes flag

* Removing logging

* Uncommenting scope, removing Start function

* Condensing error to single line

* Fixing linting errors

* Changing test

* Updating docs

* Unpluralizing text, setting nil default value

* Fixing bad help text

* Tiny refactors on the login cmd

* Fixing linting error

* Update internal/auth/auth.go

Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Rita Zerrizuela <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>

* DXCDT-271: Fix generated docs (#563)

* Rename build_doc to doc-gen

* Downgrade json flag from persistent to local

* Update doc pages

* DXCDT-272 Add install script and update README (#564)

Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Will Vedder <[email protected]>

* DXCDT-273: Authentication documentation (#565)

Co-authored-by: Will Vedder <[email protected]>

* Updating README

* Targeting main branch before we forget to change back

Co-authored-by: Sergiu Ghitea <[email protected]>
Co-authored-by: Will Vedder <[email protected]>
Co-authored-by: Sergiu Ghitea <[email protected]>
Co-authored-by: Rita Zerrizuela <[email protected]>
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.

2 participants