Class ExternalAccountCredentials.Builder

    • Field Detail

      • audience

        protected String audience
      • subjectTokenType

        protected String subjectTokenType
      • tokenUrl

        protected String tokenUrl
      • tokenInfoUrl

        protected String tokenInfoUrl
      • credentialSource

        protected com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource credentialSource
      • environmentProvider

        protected com.google.auth.oauth2.EnvironmentProvider environmentProvider
      • serviceAccountImpersonationUrl

        @Nullable
        protected String serviceAccountImpersonationUrl
      • workforcePoolUserProject

        @Nullable
        protected String workforcePoolUserProject
      • serviceAccountImpersonationOptions

        @Nullable
        protected com.google.auth.oauth2.ExternalAccountCredentials.ServiceAccountImpersonationOptions serviceAccountImpersonationOptions
    • Method Detail

      • setHttpTransportFactory

        public ExternalAccountCredentials.Builder setHttpTransportFactory​(HttpTransportFactory transportFactory)
        Sets the HTTP transport factory, creates the transport used to get access tokens.
        Parameters:
        transportFactory - the HttpTransportFactory to set
        Returns:
        this Builder object
      • setAudience

        public ExternalAccountCredentials.Builder setAudience​(String audience)
        Sets the Security Token Service audience, which is usually the fully specified resource name of the workload/workforce pool provider.
        Parameters:
        audience - the Security Token Service audience to set
        Returns:
        this Builder object
      • setSubjectTokenType

        public ExternalAccountCredentials.Builder setSubjectTokenType​(String subjectTokenType)
        Sets the Security Token Service subject token type based on the OAuth 2.0 token exchange spec. Indicates the type of the security token in the credential file.
        Parameters:
        subjectTokenType - the Security Token Service subject token type to set
        Returns:
        this Builder object
      • setTokenUrl

        public ExternalAccountCredentials.Builder setTokenUrl​(String tokenUrl)
        Sets the Security Token Service token exchange endpoint.
        Parameters:
        tokenUrl - the Security Token Service token exchange url to set
        Returns:
        this Builder object
      • setCredentialSource

        public ExternalAccountCredentials.Builder setCredentialSource​(com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource credentialSource)
        Sets the external credential source.
        Parameters:
        credentialSource - the CredentialSource to set
        Returns:
        this Builder object
      • setServiceAccountImpersonationUrl

        public ExternalAccountCredentials.Builder setServiceAccountImpersonationUrl​(String serviceAccountImpersonationUrl)
        Sets the optional URL used for service account impersonation, which is required for some APIs. If this URL is not available, the access token from the Security Token Service is used directly.
        Parameters:
        serviceAccountImpersonationUrl - the service account impersonation url to set
        Returns:
        this Builder object
      • setTokenInfoUrl

        public ExternalAccountCredentials.Builder setTokenInfoUrl​(String tokenInfoUrl)
        Sets the optional endpoint used to retrieve account related information. Required for gCloud session account identification.
        Parameters:
        tokenInfoUrl - the token info url to set
        Returns:
        this Builder object
      • setClientId

        public ExternalAccountCredentials.Builder setClientId​(String clientId)
        Sets the optional client ID of the service account from the console.
        Parameters:
        clientId - the service account client id to set
        Returns:
        this Builder object
      • setClientSecret

        public ExternalAccountCredentials.Builder setClientSecret​(String clientSecret)
        Sets the optional client secret of the service account from the console.
        Parameters:
        clientSecret - the service account client secret to set
        Returns:
        this Builder object
      • setWorkforcePoolUserProject

        public ExternalAccountCredentials.Builder setWorkforcePoolUserProject​(String workforcePoolUserProject)
        Sets the optional workforce pool user project number when the credential corresponds to a workforce pool and not a workload identity pool. The underlying principal must still have serviceusage.services.use IAM permission to use the project for billing/quota.
        Parameters:
        workforcePoolUserProject - the workforce pool user project number to set
        Returns:
        this Builder object
      • setServiceAccountImpersonationOptions

        public ExternalAccountCredentials.Builder setServiceAccountImpersonationOptions​(Map<String,​Object> optionsMap)
        Sets the optional service account impersonation options.
        Parameters:
        optionsMap - the service account impersonation options to set
        Returns:
        this Builder object
      • setUniverseDomain

        public ExternalAccountCredentials.Builder setUniverseDomain​(String universeDomain)
        Sets the optional universe domain.
        Parameters:
        universeDomain - the universe domain to set
        Returns:
        this Builder object