Skip to content

unable to login using gh auth login #5927

@rpriyanshu9

Description

@rpriyanshu9

Describe the bug

Unable to login using gh auth login.
version: gh version 2.14.0 (2022-07-12)

Steps to reproduce the behavior

  1. run gh auth login
  2. Follow the prompts
  3. Press enter to open github.com in browser
  4. Enter one-time code
  5. Authorize
  6. Check back the status in the terminal

Expected vs actual behavior

Expected: Successful login.
Actual: Got 401 error code, unauthorized.

Logs

gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser

! First copy your one-time code: xxxx-xxxx
Press Enter to open github.com in your browser... 
Opening in existing browser session.
failed to authenticate via web browser: non-200 OK status code: 401 Unauthorized body: "{\"message\":\"Bad credentials\",\"documentation_url\":\"https://docs.github.com/graphql\"}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-1Affects a large population and inhibits work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions