My intent here is to use a "Personal Access Token" to be able to clone/pull from this repo (GitLab) in a java application. I just can't figure out how to get around this error.
Here is the code I have.
String accessToken = conf.getString("accessToken");
String uri = "https://gitlab-ci-token:" + accessToken + "@gitlab.com/dfurrer/cosmotronsBinaries.git";
CredentialsProvider cp = new UsernamePasswordCredentialsProvider("PRIVATE-TOKEN", accessToken);
git = Git.cloneRepository()
.setURI(uri)
.setCredentialsProvider(cp)
.setRemote("origin")
.setBranch("master")
.call();
I get his exception:
org.eclipse.jgit.api.errors.TransportException: https://[email protected]/dfurrer/cosmotronsBinaries.git: git-upload-pack not permitted on 'https://[email protected]/dfurrer/cosmotronsBinaries.git/'
I figured out the issue. I was creating a personal access key with read_user and read_registry only. Once I created a token with api permissions I'm able to clone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With