Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ cannot log in to GitHub

For some reason, a new IntelliJ installation is unable to log in to GitHub. (The credentials are correct.)

It happens both when I try to "share project on githu" and "checkout project from version control", select Git and then try to log in to GitHub.

Here's the login prompt:

Server: github.com Login: <my username> Password: <my password> 

And the error message:

Invalid authentication data. Can't create token: scopes - [repo, gist] - not IntelliJ Plugin_1 422 Unprocessable Entity - Validation Failed [OauthAccess; description]already_exists: null 

Now, this is on a freshly installed Windows 10 computer, with a freshly installed IntelliJ. So there are no old tokens or anything like that anywhere in the system. This is the first attempt to access GitHub from IntelliJ. Logging in via web works fine.

like image 735
Hfrav Avatar asked Aug 30 '18 10:08

Hfrav


People also ask

How do I log into GitHub from IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Version Control | GitHub. Click Add account, and in the dialog that opens, click Sign up for Github. Register your account on the Sign up for GitHub page that opens. Return to the IntelliJ IDEA settings and specify your credentials.

How do I add Git credentials in IntelliJ?

In the Settings/Preferences dialog Ctrl+Alt+S , select Appearance and Behavior | System Settings | Passwords on the left. Select how you want IntelliJ IDEA to process passwords for Git remote repositories: In native Keychain: select this option to use native Keychain to store your passwords.


2 Answers

That kind of error messages can be frustrating, as it takes more than a little knowledge on the subject to understand exactly what is wrong. Usually, however, the problem is either the authentication (invalid username/email/password) or that there's a problem with git (locally).

First of all, check that you have git installed by running "git" from the command prompt. This is a more common mistake than one would think.

Second, try y.bedrov's suggestion. Log in to github.com on the web. Settings -> Developer settings -> Personal access tokens. Create a new token and then, in IntelliJ, select Enter Token at the login prompt.

Tokens are considered a more secure way to authenticate, I believe.

like image 102
Frank H. Avatar answered Sep 22 '22 07:09

Frank H.


When you make first attempt to access GitHub from IntelliJ, you do not have intellij-github authorization in place and also tokens.

So, follow the instructions here to get rid to this issue. https://www.jetbrains.com/help/idea/github.html#register-account

After this, the project can be easliy shared on github.

like image 30
SD3 Avatar answered Sep 19 '22 07:09

SD3