cli: Can't validate token
Describe the bug
I’m trying to authenticate using the gh auth login command but I get the error could not validate token: missing required scope 'repo';missing required scope 'read:org'.
I’ve already created several tokens, I even gave full permissions to one of the token to make sure it wasn’t the problem. Regardless, I always get the same error.
Steps to reproduce the behavior
- Enter the command:
gh auth login --hostname company.hostname --with-token < gh_token.txt
- Get the error:
could not validate token: missing required scope 'repo';missing required scope 'read:org'
Expected vs actual behavior
The expected result is that I’m able to authenticate but I always get the same error message. I’ve also tried to use the browser, but then I get a different error:
gh auth login --hostname company.hostname --web                                                                                                                                               
- Logging into company.hostname
failed to authenticate via web browser: could not parse interval="" as integer: strconv.Atoi: parsing "": invalid syntax
Any help is welcome.
Version
gh --version
gh version 1.0.0 (2020-09-16)
https://github.com/cli/cli/releases/tag/v1.0.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (6 by maintainers)
No no. You should make it when you generate Personal Access Token on your git account. And it should look like this.
Adding admin:org worked for me. hope this could help you guys