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

[Bug]: Github OAuth Console errors too quickly #1330

Open
rmb938 opened this issue Dec 15, 2024 · 1 comment
Open

[Bug]: Github OAuth Console errors too quickly #1330

rmb938 opened this issue Dec 15, 2024 · 1 comment
Assignees
Labels
bug needs triage Waiting for discussion / prioritization by team

Comments

@rmb938
Copy link

rmb938 commented Dec 15, 2024

Steps to Reproduce

$ step oauth --provider github --client-id ${github-app-client-id} --console

Your Environment

  • OS - Fedora 40
  • step CLI Version -
Smallstep CLI/0.28.2 (linux/amd64)
Release Date: 2024-11-20T19:14:16Z

Expected Behavior

The CLI to not error and wait an appropriate amount of time

Actual Behavior

$ step oauth --provider github --client-id ${github-app-client-id} --console
Visit https://github.com/login/device and enter the code:
5008-218F
{
  "access_token": "",
  "id_token": "",
  "refresh_token": "",
  "expires_in": 0,
  "token_type": "",
  "error": "authorization_pending",
  "error_description": "The authorization request is still pending."
}

This returns after 5 seconds, which isn't enough time to open the browser and enter the code.

Additional Context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@rmb938 rmb938 added bug needs triage Waiting for discussion / prioritization by team labels Dec 15, 2024
@rmb938
Copy link
Author

rmb938 commented Dec 15, 2024

According to https://docs.github.com/en/enterprise-cloud@latest/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app

Until the user enters the code, GitHub will respond with a 200 status and an error response query parameter. So it needs to check if the error is authorization_pending and retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

2 participants