Skip to content

GHE login needs user:email scope as minimum scope #1941

@lucasrangit

Description

@lucasrangit

Describe the bug

Using gh 1.0.0 and GitHub Enterprise (GHE) 2.20.12, I could not login with a personal access token until I added the user:email scope.

Only the repo and read:org scopes were listed as required.

Steps to reproduce the behavior

1, Create token with repo and read:org scopes.

  1. Install gh from Debian repository
  2. Perform login using token gh auth login --hostname github.company.net
  3. Observe the error could not validate token: missing required scope 'repo';missing required scope 'read:org'
  4. Add user:email scope to existing token.
  5. Re-try login gh auth login --hostname github.company.net
  6. Observe the error is gone and the login succeeded.

Expected vs actual behavior

The error message should include user:email as a minimum required scope.

Logs

~$ gh auth login --hostname 'github.company.net'
- Logging into github.company.net
? How would you like to authenticate? Paste an authentication token

Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo' and 'read:org'.
? Paste your authentication token: ****************************************
? Choose default git protocol SSH
- gh config set -h github.company.net git_protocol ssh
✓ Configured git protocol
✓ Logged in as username

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmore-info-neededMore info needed from user/contributorpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions