Github Enterprise PAT not working anymore for https

Answered

Using IntelliJ IDEA 2022.3 (Ultimate Edition) on Ubuntu Jammy, I was accessing the company's Git repositories using Https + PAT (username as username, PAT as password).

Suddenly, this combination ceased to work, while I can still access the repo using command line "git fetch" command. So my PAT is still fine, but Intellij seems to transmit this values differently.

I've tried to setup a new PAT, but that didn't work either.

I had this issue a couple weeks already, but it somehow self-healed after about 2 days.

I've seen, most people resolved that issue by providing their username as username and PAT as password - but that's what I've been doing for years now.

15:36:56.344: [COMPANY_REPO] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false fetch origin --recurse-submodules=no --progress --prune
remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.
remote: See https://git.COMPANY_HOST.com/settings/tokens or https://git.i.mercedes-benz.com/settings/ssh
fatal: unable to access 'https://git.COMPANY_HOST.com/COMPANY_REPO/': The requested URL returned error: 403

Thanks alot

0
16 comments

Please try the following:

  • Enable Do not save option in Settings (⌘ + ,) > Appearance & Behavior > System Settings > Passwords
  • Enable the Use credential helper in Settings (⌘ + ,) > Version Control > Git
  • File > Invalidate Caches.. > enable Clear file system cache and Local History and Clear VCS Log caches and indexes options > Invalidate and Restart
  • Try again to update the project

If the issue persists, please share your IDE log (Help > Collect Logs and Diagnostic Data) for further analysis. Thanks!

0

Hello Ivan,

I reset as described by your comment, but the problem persists.

How can I provide you the logs? Since they "may contain sensitive data", I would rather not upload them here.

Thanks a lot.

Stefan Schilling

0

You can upload securely via: https://uploads.jetbrains.com, just provide the uploaded file ID after that.
Are you using the same git installation for IntelliJ and when running git fetch in command line? You can check the git path in Settings (`Ctrl + Alt + S`) > Version Control > Git.

Also, check if you have a .git-credentials file with incorrect credentials stored.
Another thing to try to remove incorrect credentials cached, is to run following command:

git credential-cache exit
0

Hello again,

1. Upload id: 2023_05_16_234Vq6hWRw4imw5o1o6UX1 (file: idea-logs-20230516-1257009270330243197904809.zip)

2. yes, both variants use the same /usr/bin/git, which is git version 2.34.1

3. .git-credentials file is empty (I've set back the settings to use the system-internal key vault, which is KDE KWalletManager)

Thanks.

Stefan

0

Thanks - while I check the logs please try to remove the cached credentials from the KDE WalletManager.
Also, did you try to remove the incorrect cached credentials via running:

git credential-cache exit

Another thing, if possible, it is recommended to use ssh key authentication over https as it is more secure and easier to use.

0

Hello Ivan,

yes, I just removed all cached Git entries from KDE WalletManager, ran

git credential-cache exit

restarted Intellij and tried again: no change.

I've also found out, that another colleague has the exact same issue.

I know, but I prefer to continue using https, because I have to switch computers once in a while and this way I can just use my password.

Regards,

Stefan

0

Hello Ivan Pajic,

any updates here?

I had to renew my PAT and set it as my account's password in Intellij. But still no change, the PAT gets rejected; Intellij continues to ask for a PAT, rather than a password - but that's what I've provided.

Thanks.

Stefan

0
Hello

Thank you for contacting JetBrains Support.

I am terribly sorry for the delayed response.

Could you please whether you have password safe enabled under File | Settings | Appearance & Behavior | System Settings | Passwords?

Also, would you be able to share exact screenshot of an error message that you are seeing? 

Also, what scopes have you granted to your PAT? 
It seems that those permissions that are mentioned in our dialog are not enough:
https://youtrack.jetbrains.com/issue/IDEA-320804

Please enable debug logs (Help - Diagnostic Tools - Debug Log Settings...) for the following category:
#org.jetbrains.plugins.github

Then please reproduce the issue and share the entire logs folder zipped as per https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files
0

Hello Ruslan Kuleshov,

thanks for your quite response.

1. yes, saving the password is activated, it shall use "In native Keychain". When the PAT changed, I was asked to provide those details using a KDE-native dialogue (and provided the data, of course). Now, it's an Intellij native dialogue.

 

2. scopes assigned to the PAT: repo, workflow. I just changed the scope to gist, read:org, read:user, repo, user:email, workflow, but that didn't change anything.

3. I've uploaded the log file, Upload id: 2023_06_07_uD44kvBCPuqs3wnsbm8ttJ (file: idea-logs-20230607-13010012883346512074831783.zip)

Thanks a lot.

Stefan

0

Hello Ruslan Kuleshov,

any news on this?

I've been in touch with our Github guys and they say, there is no issue on Github's side.

I guess, that Intellij just does not properly obtain/set the PAT when accessing the repo.

Stefan

0

Hello Stefan Schilling

Could you please check whether you are logged into GitHub Account under File | Settings | Version Control | GitHub?
It looks like IDE is trying to go to your repository with plain auth while GitHub requires token only (you can try to use token in username field and see if it helps)

0

Hello Ruslan Kuleshov,

yes, I'm logged into Github using my personal (private) account. This works (as of now), using a PAT created from Github.com.

The connection I'm discussing here, is company account for another Github (Enterprise server) instance, run in a company environment - not related in any way to the Github.com account. Sorry, maybe I should have made that distinction clearer, with "Github" I meant the software product, not Github.com as a software repo site.

Stefan

 

0

Hello Stefan Schilling

Thank you for clarification.
I do understand that you mean GitHub enterprise server + work account.
In IDE's settings File | Settings | Version Control | GitHub you can click on + sign and then choose "Log in the GitHub Enterprise" and then you can enter URL to your GitHub Enteprise server along with your PAT.
Did you have a chance to add your account this way to your IDE's settings?

0

Hello Ruslan Kuleshov,

I'm able to add this account to my IDE settings. BUT: those settings seem not to be used for Git operations.

I added it using

1. https://ACCOUNT_NAME@SERVER

2. https://SERVER

Neither worked, the IDE keeps asking me for the password and does not accept my PAT as valid password.

Stefan

0

Hello Stefan Schilling

 

Could you please open a support ticket and attach a screencast of your actions? That would help to see what you have while configurin GitHub Enterprise 

0

Please sign in to leave a comment.