Hub: Requires Authentication Error - but never prompted for credentials

Created on 22 Sep 2019  路  5Comments  路  Source: github/hub

Just installed hub using chocolatey on Windows, and I get an error as soon as a I try to execute any commands

When I run the following command

HUB_VERBOSE=1 hub issue

I get the following output

$ git rev-parse -q --git-dir
$ git remote -v
$ git config --get-all hub.host
github.com username: [email protected]
github.com password for [email protected] (never stored):
> POST  https://api.github.com/authorizations
> Authorization: Basic [REDACTED]
> Accept: application/vnd.github.v3+json;charset=utf-8
{"note":"hub for KyleMit@SurfaceWhoa","note_url":"https://hub.github.com/","scopes":["repo"]}
< HTTP 401
{"message":"Requires authentication","documentation_url":"https://developer.github.com/v3"}
Requires authentication

example

According to the docs on GitHub OAuth authentication, II should be prompted for username/password, but after I enter the username, the auth immediately fails and never prompts for a password

I tried to delete ~/.config/hub, but it doesn't exist.

How can I prompt for / reset authentication?

Environment

OS

$ systeminfo | grep "OS Name\|Version"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18980 N/A Build 18980

Hub Version

$ hub version
git version 2.20.1.windows.1
hub version 2.12.6

Similar Issues

579 Cannot get past authentication

965 This API can only be accessed with username and password Basic Auth" on create or pull-request

1672 This API can only be accessed with username and password Basic Auth" on create or pull-request

1067 hub complains "Unauthorized (HTTP 401)" and "Bad credentials

1486 hub checkout asks for username and password

bug

All 5 comments

Same issue here. I too installed using Choco on Windows 10. I can run git pull with no problems. "git pull-request" asks for a username and then immediately says "Error creating pull request: Unauthorized (HTTP 401)" Requires authentication. I even set these two environmental variables. Same error.

GITHUB_USER
The GitHub username of the actor of GitHub API operations.

GITHUB_PASSWORD
The GitHub password used to exchange user credentials for an OAuth token that gets stored in hub configuration. If not set, it may be interactively prompted for on first run.

Thank you for reporting!

  1. What is your hub version?
  2. Can you try the precompiled Windows build from here instead of the Choco version?

@jtawil777 If you've correctly set GITHUB_USER and GITHUB_PASSWORD in your environment, then hub wouldn't ask you for neither username nor password (it would instead get the values from environment variables). How did you set these variables and what are you using as your shell?

@KyleMit Does setting GITHUB_PASSWORD=<password> in your environment work around getting prompted for password on your end?

Pushing another release that may fix the issue https://github.com/github/hub/releases/tag/v2.12.7

Sorry for the trouble!

Yep, v2.12.7 fixed the issue!! 馃帀

I updated the original comment with the hub version as well which was on v2.12.6

Thanks so much!

Just for completeness.
faced the same issue installing hub from conda-forge

$ hub --version
git version 2.7.4
hub version 2.12.3
Was this page helpful?
0 / 5 - 0 ratings