Magnus
Magnus

Reputation: 18758

Can't push to Github from IntelliJ, even after adding access token

When trying to push to Github from IntelliJ, it keeps saying that password authentication was removed on august 13 2021, and that I should use an access token.

I have added an access token by going to Preferences / Version Control / Github, but it still keeps giving me the same error. It's as if IntelliJ stored a password somewhere a long time ago, and is now trying to use that instead of the access token for some reason.

How do I force IntelliJ to use the access token that I've given it?

Upvotes: 2

Views: 3582

Answers (2)

Antoine-prog
Antoine-prog

Reputation: 11

You have to use a token that have a complete read/write acces to the API.

So when creating a token, you have to check "api" and "read_api".

Gitlab token option

Upvotes: 1

Magnus
Magnus

Reputation: 18758

After trying to solve it from within IntelliJ a few times by removing the Github account and adding it again (with an access token), I finally found a way to make it work. This solution only applies to Mac OSx.

  1. Remove the Github account from IntelliJ Preferences.

  2. Open the Keychain Access system app.

  3. Select "All items" and then search for "github".

  4. Delete all results. Only removing the ones that begin with "IntelliJ ..." didn't work, I had to remove all of them.

  5. Now, go back to IntelliJ Preferences and add the Github account, and make sure to use an access token. You're done.

Upvotes: 2

Related Questions