feat(auth): add OAuth PKCE browser flow by LorrisSaintGenez · Pull Request #198 · algolia/cli

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@LorrisSaintGenez

Copy link Copy Markdown

Contributor

@LorrisSaintGenez LorrisSaintGenez commented

Mar 17, 2026

edited

Loading

Summary

  • algolia auth login: Browser-based sign-in using OAuth 2.0 Authorization Code + PKCE
  • algolia auth signup: Same flow, but opens the sign-up page directly
  • algolia auth logout: Revoke the tokens, delete the one stored in the keychain
  • Token storage: Access/refresh tokens persisted in the OS keychain, with automatic refresh

Env. config

  • ALGOLIA_DASHBOARD_URL
  • ALGOLIA_API_URL
  • ALGOLIA_OAUTH_CLIENT_ID
  • ALGOLIA_OAUTH_SCOPE

Manual testing

Set those value above. If you use it with the local dashboard, set up also ALGOLIA_SEARCH_HOSTS if you want to test indices command.

  • ./algolia auth signup --> should prompt to create a new application (select CA or DE locally)
  • ./algolia auth login

@LorrisSaintGenez LorrisSaintGenez merged commit 6a437c3 into main

Mar 18, 2026

3 checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@8bittitan 8bittitan 8bittitan approved these changes

@pipeline1987 pipeline1987 pipeline1987 approved these changes

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@LorrisSaintGenez @8bittitan @pipeline1987