Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't connect to a private repo anymore #30

Open
fabriceci opened this issue Apr 13, 2022 · 6 comments
Open

I can't connect to a private repo anymore #30

fabriceci opened this issue Apr 13, 2022 · 6 comments

Comments

@fabriceci
Copy link

I reopened a project where I was using a private repo with HTTPS authentication and an AuthGroup, it worked fine but it seems we can't use this type of authentication with Github anymore (if I'm not mistaken).

I didn't find how to use an access token (I tried replace the password by the token), so I tried with SSH but got the following error:

Failed to notify build listener.
> Invalid remote: origin

I try if my SSH connexion is valid with ssh -T git@github.com and it works fine : Hi fabriceci! You've successfully authenticated, but GitHub does not provide shell access.

Here if my config:

git {
    implementation 'git@github.com:fabriceci/xxx.git', {
        authGroup 'ssh'
        keepUpdated false
    }
}

I was not sure, but I put my SSH password in my gradle properties file (As I used to do before the classic user/pass connection) :

 git.ssh.password=xxx

Have you an idea how to solve this?

@alexvasilkov
Copy link
Owner

Try removing authGroup 'ssh', does it help?

@fabriceci
Copy link
Author

No, the same error. (Note as the ssh key is protected by a password, so the password should be added somewhere to expect to work.)

@alexvasilkov
Copy link
Owner

Hm, I fear ssh keys protected with passphrase are not supported right now.
Since you have access token, can you please try to use it as username and use empty password, does it help?

@fabriceci
Copy link
Author

Unfortunately not:

Git dependency: 'password' is not specified for 'xxx'.
You should provide 'git.main.password' as command line argument (-Dgit.main.password=...) OR in gradle.properties OR in local.properties OR in

Same for the inverse: Git dependency: 'username' is not specified for 'xxx'. (I already tried add the access token as the password)

@alexvasilkov
Copy link
Owner

What if you use random password, e.g. "x"?
If token auth doesn't work then I fear that you have to use unprotected ssh key after all. I may try to add passphrase support at some point in the future.

@fabriceci
Copy link
Author

fabriceci commented Apr 13, 2022

I may try to add passphrase support at some point in the future.

It would be useful, the user/pass should also be replaced by access tokens. When you have the mood and the time! Thanks for your help!

I found a workaround for me without removing my SSH pass:
When I set the token as the password, I don't notice the first time but it fails with a different error and creates empty folders in libs/ So I manually cloned the repositories inside them and it works 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants