Class DefaultCredentialsProvider

java.lang.Object
com.google.cloud.spring.core.DefaultCredentialsProvider
All Implemented Interfaces:
com.google.api.gax.core.CredentialsProvider

public class DefaultCredentialsProvider extends Object implements com.google.api.gax.core.CredentialsProvider
A CredentialsProvider implementation that wraps credentials based on user-provided properties and defaults.
  • Constructor Summary

    Constructors
    Constructor
    Description
    The credentials provided by this object originate from the following sources: *.credentials.location: Credentials built from JSON content inside the file pointed to by this property, *.credentials.encoded-key: Credentials built from JSON String, encoded on base64, Google Cloud Client Libraries default credentials provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.auth.Credentials
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultCredentialsProvider

      public DefaultCredentialsProvider(CredentialsSupplier credentialsSupplier) throws IOException
      The credentials provided by this object originate from the following sources:
      • *.credentials.location: Credentials built from JSON content inside the file pointed to by this property,
      • *.credentials.encoded-key: Credentials built from JSON String, encoded on base64,
      • Google Cloud Client Libraries default credentials provider.

      If credentials are provided by one source, the next sources are discarded.

      Parameters:
      credentialsSupplier - provides properties that can override OAuth2 scopes list used by the credentials, and the location of the OAuth2 credentials private key.
      Throws:
      IOException - if an issue occurs creating the DefaultCredentialsProvider
  • Method Details

    • getCredentials

      public com.google.auth.Credentials getCredentials() throws IOException
      Specified by:
      getCredentials in interface com.google.api.gax.core.CredentialsProvider
      Throws:
      IOException