hub
hub copied to clipboard
Unable to authorize GitHub password (Unathorized/Not Found)
I already put an alias for hub on my
.bashrc
alias git=hub
But when I want to create a repos my credentials always failed
Command attempted: git create jam_hub github.com username: flyingduck92 github.com password for flyingduck92 (never stored):
What happened: Error creating repository: Unauthorized (HTTP 401) Bad credentials. The API can't be accessed using username/password authentication. Please create a personal access token to access this endpoint: http://github.com/settings/tokens
More info: git version 2.29.1.windows.1 hub version 2.14.2
I had the same issue. I went to the github tokens link provided and made a token, and now it works.
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least repo
scope) at https://github.com/settings/tokens and paste it instead of the password.
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least
repo
scope) and paste it instead of the password.
Oh okay, I will try usng Personal Access Token then. Cheers sir
Hello, I uninstalled hub gem and did the update wit Homebrew
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least
repo
scope) at https://github.com/settings/tokens and paste it instead of the password.
This didn't fix it for me. Error stays the same. I will try to find a fix.
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least
repo
scope) at https://github.com/settings/tokens and paste it instead of the password.
You have NO idea how much I searched the internet to find this solution! THANK YOU!
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least
repo
scope) at https://github.com/settings/tokens and paste it instead of the password.
Thanks @mislav. That worked for me!
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least
repo
scope) at https://github.com/settings/tokens and paste it instead of the password.
This information should be in the readme, and not in an issue.
Why was this issue closed? This seems like a pretty major issue.
True— it's not solved yet, so I'm reopening.
@mislav Can we change the intimation message until this is fixed? Something like github.com token for <user>:
rather than github.com password for <user>:
? I think the message is fairly confusing.
Is there a way to change the message, just like @bharath-123 said ?
@mislav Can we change the intimation message until this is fixed? Something like
github.com token for <user>:
rather thangithub.com password for <user>:
? I think the message is fairly confusing.
I was hoping that we could save the token somewhere too, is that possible ?
Edit: Found this on Hub Configurations
Hub will prompt for GitHub username & password the first time it needs to access the API and exchange it for an OAuth token, which it saves in ~/.config/hub.
To avoid being prompted, use GITHUB_USER and GITHUB_PASSWORD environment variables.
Alternatively, you may provide GITHUB_TOKEN, an access token with repo permissions. This will not be written to ~/.config/hub.
Repo successful created with the token, but when i try to git push origin master
, i get git@github: permission-denied
.
Repo successful created with the token, but when i try to
git push origin master
, i getgit@github: permission-denied
.
if your trying to push with git could most likely be a setting there. Do you have it set up for https or ssh?
Since it doesn't seem to have been posted here, GitHub added an OAuth flow that doesn't need a web browser/server: https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow
Since it doesn't seem to have been posted here, GitHub added an OAuth flow that doesn't need a web browser/server: https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow
I just always do SSH as I know how to get it working, however I ended up here as I completely forgot about the token thing, they really need to update the word password to token really.
Why did Git do something that would break a common workflow without first providing a fix for that workflow? Sounds a lot like something Microsoft would do...
Repo successful created with the token, but when i try to
git push origin master
, i getgit@github: permission-denied
.if your trying to push with git could most likely be a setting there. Do you have it set up for https or ssh?
I'm using https
Why did Git do something that would break a common workflow without first providing a fix for that workflow?
They did provide a fix. The device authorization flow was added on 2020-07-27. Token authentication began warning on 2020-07-30, and was disabled on 2020-11-13.
If you're referring to hub, it isn't officially supported by GitHub. My understanding is that it's only part of the @github organization for historical reasons.
@leo60228 "If you're referring to hub, it isn't officially supported by GitHub. My understanding is that it's only part of the @github organization for historical reasons."
What else would I be talking about in the hub repository?
If GitHub no longer wants to support hub, then what alternative (CLI, NOT GUI) do they propose? Of course I can use plain old git, but there was considerable convenience added with hub that has now been partially eliminated.
gh, which is linked in the hub README.
I don't believe hub was ever supported by GitHub. I'm pretty sure that it's only in this organization because it was (is?) originally developed by a GitHub employee.
This wasted me some time so I want to write down the solutions. If you have time to switch to gh
, do it, otherwise:
-
Generate PAT (with repo scope)
-
Create a
~/.config/hub
file like below (per mislav's comment). Put in your username asuser
and paste your PAT onoauth_token
.github.com: - user: mislav oauth_token: PASTE_YOUR_TOKEN_HERE protocol: https
-
Try
hub clone
delete ~/.config/hub works to me!
i created the repo with the below command and the push origin master worked: $ gh repo create
This wasted me some time so I want to write down the solutions. If you have time to switch to
gh
, do it, otherwise:
- Generate PAT (with repo scope)
- Create a
~/.config/hub
file like below (per mislav's comment). Put in your username asuser
and paste your PAT onoauth_token
.github.com: - user: mislav oauth_token: PASTE_YOUR_TOKEN_HERE protocol: https
- Try
hub clone
Thanks. This worked.
Somehow the password is not accepting the token I generated. Or is returning a 404.
I'm sorry for the inconvenience. GitHub deprecated its Authorizations API, which hub relied on for exchanging a password for a token.
Until we fix this in hub, the solution is to generate a Personal Access Token (with at least
repo
scope) at https://github.com/settings/tokens and paste it instead of the password.
It works !!! Thank you so much ❤️
I am facing a similar issue, in past whenever i did git push origin master on the new repo using git bash, it prompted me with a username and password screen, where in pwd i used to enter PAT, and things would just work fine. But this time gitbash is not prompting me with username and password.
i has to change url to https inside .git/config in order to get it up and running [remote "origin"] url = https://github.com/...
Access Token stops working...
I was able to get this working by generating a PAT per the linked docs, and then setting up a hub
config file in: ~/.config/hub
:
github.com:
- user: < user_name >
oauth_token: < PAT >
protocol: https