Interface GoogleOAuth2Credentials
- All Superinterfaces:
com.cloudbees.plugins.credentials.Credentials,Describable<com.cloudbees.plugins.credentials.Credentials>,ExtensionPoint,com.cloudbees.plugins.credentials.common.IdCredentials,com.google.jenkins.plugins.credentials.oauth.OAuth2Credentials<GoogleOAuth2ScopeRequirement>,Serializable,com.cloudbees.plugins.credentials.common.StandardCredentials,com.cloudbees.plugins.credentials.common.StandardUsernameCredentials,com.google.jenkins.plugins.credentials.oauth.StandardUsernameOAuth2Credentials<GoogleOAuth2ScopeRequirement>,com.cloudbees.plugins.credentials.common.UsernameCredentials
- All Known Implementing Classes:
GoogleRobotCredentials,GoogleRobotMetadataCredentials,GoogleRobotPrivateKeyCredentials
public interface GoogleOAuth2Credentials
extends com.google.jenkins.plugins.credentials.oauth.StandardUsernameOAuth2Credentials<GoogleOAuth2ScopeRequirement>
Google-specific username / access token combination.
Implementations surface an API for obtaining the Google-standard Credential object for
interacting with OAuth2 APIs.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.IdCredentials
com.cloudbees.plugins.credentials.common.IdCredentials.HelpersNested classes/interfaces inherited from interface com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.NameProvider -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.client.auth.oauth2.CredentialgetGoogleCredential(GoogleOAuth2ScopeRequirement requirement) Fetches a Credential for the set of OAuth 2.0 scopes required.Methods inherited from interface com.cloudbees.plugins.credentials.Credentials
forRun, getDescriptor, getScopeMethods inherited from interface com.cloudbees.plugins.credentials.common.IdCredentials
getIdMethods inherited from interface com.google.jenkins.plugins.credentials.oauth.OAuth2Credentials
getAccessTokenMethods inherited from interface com.cloudbees.plugins.credentials.common.StandardCredentials
getDescriptionMethods inherited from interface com.cloudbees.plugins.credentials.common.UsernameCredentials
getUsername, isUsernameSecret
-
Method Details
-
getGoogleCredential
com.google.api.client.auth.oauth2.Credential getGoogleCredential(GoogleOAuth2ScopeRequirement requirement) throws GeneralSecurityException Fetches a Credential for the set of OAuth 2.0 scopes required.- Parameters:
requirement- The set of required OAuth 2.0 scopes- Returns:
- The Credential authorizing usage of the API scopes
- Throws:
GeneralSecurityException- when the authentication fails
-