artifactory-client-java
artifactory-client-java copied to clipboard
Use Artifactory API Key to login with artifactory.client
If it's possible to log in with the Artifactory API key I could bypass the corporate LDAP. The LDAP can be a slowing factor and I read that the API key bypasses the problem.
When setting up the connection with Artifactory you can give X-JFrog-Art-Api: <YOUR_API_KEY> as header.
the solution could look like:
//new part
if (apiKey) {
client.headers.'X-JFrog-Art-Api'= apiKey
}
//This is already there ->
if (username && password) {
client.auth.basic username, password
client.headers.Authorization = "Basic ${"$username:$password".toString().bytes.encodeBase64()}"
}
@vincentfree, Will you be able to test this and submit pull request? We'd gladly accept it.
Hey @eyalbe4 i'll submit a pull request and add tests. should not take to long, didn't have time with the new year etc.
Great @vincentfree. Happy new year!