Skip to content

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

Merged
mislav merged 2 commits intotrunkfrom
ghe-paste-token
Feb 23, 2021
Merged

Fix pasting Personal Access Token to auth login for GHE#3019
mislav merged 2 commits intotrunkfrom
ghe-paste-token

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