Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Validating the git credentials of the user

On Fri, Jan 29, 2021 at 8:30 AM Deepak Patankar <patankardeepak04@xxxxxxxxx> wrote:
Hello Everyone!!

I am writing an application in which we will support git integration using jgit. The user will provide us with his git credentials so that we can push some files on his git.

The git credentials which user will supply can be

  1. The Account URL, eg: https://github.com/OpenPrinting
  2. HTTP (Username and Password/ Kerberos)
  3. SSH

Before saving the user credentials I want to validate that the credentials entered is valid.

I think there is no need to run an extra request to validate credentials. 
I'd defer asking for credentials until they are needed the first time and save them (encrypted) only after authentication was successful,
and not save them if authentication failed
 

The user might be using GitHub/BitBucket/GitLab. I am trying to find some git command or some way using jgit which I can use to validate the credentials. Can you please point me to some command/logic which I can try?

What I have tried? 
I tried git ls-remote command, but it requires the repo name/ repo url. The user won't specify the repository name or URL beforehand at the time of testing. Because of which I am not able to use this command.


Thanks
Deepak

_______________________________________________
jgit-dev mailing list
jgit-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jgit-dev

Back to the top