Class BitbucketAccessTokenAuthenticator
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketAccessTokenAuthenticator
- All Implemented Interfaces:
BitbucketAuthenticator
Authenticator that uses an access token.
-
Field Summary
Fields inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator
BITBUCKET_INSTANCE_TYPE, BITBUCKET_INSTANCE_TYPE_CLOUD, BITBUCKET_INSTANCE_TYPE_SERVER, SCHEME, SERVER_URL -
Constructor Summary
ConstructorsConstructorDescriptionBitbucketAccessTokenAuthenticator(org.jenkinsci.plugins.plaincredentials.StringCredentials credentials) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureRequest(org.apache.hc.core5.http.HttpRequest request) Provides the access token as header.com.cloudbees.plugins.credentials.common.StandardUsernameCredentialsProvides with the Git command line interface.getId()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator
configureBuilder, configureContext
-
Constructor Details
-
BitbucketAccessTokenAuthenticator
public BitbucketAccessTokenAuthenticator(org.jenkinsci.plugins.plaincredentials.StringCredentials credentials) Constructor.- Parameters:
credentials- the access token that will be used
-
-
Method Details
-
configureRequest
public void configureRequest(org.apache.hc.core5.http.HttpRequest request) Provides the access token as header.- Specified by:
configureRequestin interfaceBitbucketAuthenticator- Parameters:
request- to configure with the access token
-
getCredentialsForSCM
public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentialsForSCM()Provides with the Git command line interface.As per documentation the username must be x-token-auth and the password is the token.
- Specified by:
getCredentialsForSCMin interfaceBitbucketAuthenticator- Returns:
- the UsernamePasswordCredentials credential to be used with Git command line interface
-
getId
- Specified by:
getIdin interfaceBitbucketAuthenticator- Returns:
- id of the credentials used.
-