In this case no authentication method is set. Now let's see how to add a username and password in case of for example private repos:
In this case you only need to set as credential provider the UsernameAndPasswordCredentialsProvider and pass the required username and password.
The final scenario I am going to show here is how to authenticate against a git repository using your ssh keys, that is using (~/.ssh/id_rsa) and setting the passphrase to access it.
In this case you need to extend JSchConfigSessionFactory to be able to set passphrase to access to private key. To do it you set a custom UserInfo implementation where the getPassphrase method returns the passphrase to use and promptPassphrase method should return true.
After that you only need to set the transport configuration to the one created.
We keep learning,
Chan eil inneal-ciùil a ghleusar, 'Dhùisgeas smuain mo chléibh gu aoibh, Mar nì duan o bheul nan caileag, Oidhche mhath leibh, beannachd leibh (Oidche Mhath Leibh - Ossian)Music: https://www.youtube.com/watch?v=mi4SCOYAdEk