8000 Fix pasting Personal Access Token to `auth login` for GHE by mislav · Pull Request #3019 · cli/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix pasting Personal Access Token to auth login for GHE #3019

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

Merged
merged 2 commits into from
Feb 23, 2021
Merged

Conversation

mislav
Copy link
Contributor
@mislav mislav commented Feb 23, 2021

After pasting a Personal Access Token during auth login, the flow would error out while trying to verify that the token has correct scopes. This was because of a malformed Authorization header. GitHub.com users were not affected because the API endpoint that was contacted is public and works without Authorization.

Additionally, the workflow scope is not present in GHE versions 2.x. Since we do not know which version of GHE the user plans to authenticate to, suggest in the UI that the workflow scope is only applicable to GHE 3.x:

$ gh auth login -h ghe.io
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://ghe.io/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'workflow' (GHE 3.0+).
? Paste your authentication token:

Fixes #3014
Regression from #2892

@mislav mislav merged commit d6798b1 into trunk Feb 23, 2021
@mislav mislav deleted the ghe-paste-token branch February 23, 2021 10:34
@tmccarry5150
Copy link

Thanks

1 similar comment
@tmccarry5150
Copy link

Thanks

@tmccarry5150
Copy link

Thank you do your all your info

@greenorchad
Copy link
greenorchad commented Feb 26, 2021 via email

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.

gh auth login fails from 1.6.0 to GHE < 3
3 participants
0