Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Login to GitHub failed both HTTPS and SSH(GitHub won't take my credentials over either HTTPS or SSH)
Login to GitHub failed both HTTPS and SSH [message #1850429] Wed, 02 March 2022 16:34 Go to next message
Neil Aggarwal is currently offline Neil AggarwalFriend
Messages: 9
Registered: July 2021
Junior Member
Hello:

I set up a new private repository on GitHub. I read on this forum that there was a bug which has been fixed in the nightly build so I installed the EGit nightly but that did not fix it.

When I try to close a repository using HTTPS, I get this exception:
org.eclipse.jgit.api.errors.TransportException: https://github.com/NeilAgg2001/PfMarketing.git: not authorized
	at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:189)
	at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:128)
	at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:116)
	at org.eclipse.egit.ui.internal.clone.SourceBranchPage$9.run(SourceBranchPage.java:377)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/NeilAgg2001/PfMarketing.git: not authorized
	at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:685)
	at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
	at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:167)
	... 4 more


When I try to login using SSH, I get this error:
org.eclipse.jgit.api.errors.TransportException: NeilAgg2001@github.com:NeilAgg2001/PfMarketing.git: Cannot log in at github.com:22
	at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:189)
	at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:128)
	at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:116)
	at org.eclipse.egit.ui.internal.clone.SourceBranchPage$9.run(SourceBranchPage.java:377)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.eclipse.jgit.errors.TransportException: NeilAgg2001@github.com:NeilAgg2001/PfMarketing.git: Cannot log in at github.com:22
	at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:178)
	at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:99)
	at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:251)
	at org.eclipse.jgit.transport.sshd.SshdSessionFactory.getSession(SshdSessionFactory.java:1)
	at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:107)
	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:281)
	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:153)
	at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:167)
	... 4 more
Caused by: org.apache.sshd.common.SshException: No more authentication methods available
	at org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:126)
	at org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:39)
	at org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:32)
	at org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:68)
	at org.eclipse.jgit.transport.sshd.SshdSession.connect(SshdSession.java:168)
	... 11 more
Caused by: org.apache.sshd.common.SshException: No more authentication methods available
	at org.apache.sshd.client.session.ClientUserAuthService.tryNext(ClientUserAuthService.java:353)
	at org.apache.sshd.client.session.ClientUserAuthService.processUserAuth(ClientUserAuthService.java:288)
	at org.apache.sshd.client.session.ClientUserAuthService.process(ClientUserAuthService.java:225)
	at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:526)
	at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:452)
	at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1524)
	at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:412)
	at org.eclipse.jgit.internal.transport.sshd.JGitClientSession.messageReceived(JGitClientSession.java:197)
	at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
	at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:359)
	at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:336)
	at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:333)
	at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
	at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
	at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127)
	at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219)
	at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:831)


Here is the SessionData:
eclipse.buildId=4.22.0.I20211124-1800
java.version=16.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product


What do I do now?
Re: Login to GitHub failed both HTTPS and SSH [message #1850430 is a reply to message #1850429] Wed, 02 March 2022 16:37 Go to previous messageGo to next message
Neil Aggarwal is currently offline Neil AggarwalFriend
Messages: 9
Registered: July 2021
Junior Member
When I change my repository to public, I was able to login over HTTPS without any problems, but that is not a valid workaround. I do not want the repository code visible to others.
Re: Login to GitHub failed both HTTPS and SSH [message #1850431 is a reply to message #1850430] Wed, 02 March 2022 16:42 Go to previous messageGo to next message
Neil Aggarwal is currently offline Neil AggarwalFriend
Messages: 9
Registered: July 2021
Junior Member
If I switch my project back to private, EGit asks for the login credentials again and fails.
Re: Login to GitHub failed both HTTPS and SSH [message #1850432 is a reply to message #1850431] Wed, 02 March 2022 17:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Are you logging in with your personal access token? I believe the account password will not work anymore...

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Login to GitHub failed both HTTPS and SSH [message #1850433 is a reply to message #1850432] Wed, 02 March 2022 20:17 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
Yes, for HTTPS use a personal access token (PAT). Just enter the PAT instead of a password when EGit asks for the log-in credentials. To be able to access private repositories, the PAT must have the "repo" scope. See the EGit User's Guide.

For SSH, do _not_ use your username. Use "git@github.com". (And of course, have the public key installed on Github.)
Re: Login to GitHub failed both HTTPS and SSH [message #1850457 is a reply to message #1850433] Thu, 03 March 2022 15:00 Go to previous message
Neil Aggarwal is currently offline Neil AggarwalFriend
Messages: 9
Registered: July 2021
Junior Member
I did not realize I needed to generate a PAT. That worked. Thank you!
Previous Topic:Does JGit has LFS file locking APIs
Next Topic:SQL file SHA1 id is different based on OS
Goto Forum:
  


Current Time: Sat Apr 20 01:30:09 GMT 2024

Powered by FUDForum. Page generated in 0.03731 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top