Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Is it possible to check user/password credentials valid on repository?
Is it possible to check user/password credentials valid on repository? [message #1796117] Fri, 05 October 2018 12:23 Go to next message
Phil Beauvoir is currently offline Phil BeauvoirFriend
Messages: 62
Registered: October 2012
Member
If I call a FetchCommand (with UsernamePasswordCredentialsProvider) and the username or password is incorrect an exception is thrown:

org.eclipse.jgit.api.errors.TransportException: https://bitbucket.org/user/repo.git: not authorized

or

org.eclipse.jgit.api.errors.TransportException: https://bitbucket.org/user/repo.git: authentication not supported

And if a connection is bad I get also a TransportException such as:

org.eclipse.jgit.api.errors.TransportException: https://bitbucket.org/user/repo.git: cannot open git-upload-pack

I would really like to be able to differentiate between these TransportExceptions by some means other than the text message. Ideally I would like to ensure that the user's password is correct before too many retries lock them out.

Is there a way to check once if the username and password is correct?

Thanks in advance for any help.
Re: Is it possible to check user/password credentials valid on repository? [message #1797283 is a reply to message #1796117] Mon, 29 October 2018 13:59 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Looks like we have room for improvements here. We could either subclass TransportException to differentiate or
add a reason id or enum to the TransportException which would allow to differentiate based on the reason.

"not authorized" means that authentication failed due to wrong credentials
"authentication not supported" means that jgit does not support the authentication method the server wants.
Previous Topic:JGit : Problem with using the Bundlewriter
Next Topic:Feature ideas - post in Bugzilla?
Goto Forum:
  


Current Time: Thu Mar 28 11:28:05 GMT 2024

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

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

Back to the top