Class GoogleAuthUtils

java.lang.Object
com.google.auth.oauth2.GoogleAuthUtils

public class GoogleAuthUtils extends Object
This public class provides shared utilities for common OAuth2 utils or ADC. It also exposes convenience methods such as a getter for well-known Application Default Credentials file path
  • Constructor Details

    • GoogleAuthUtils

      public GoogleAuthUtils()
  • Method Details

    • getWellKnownCredentialsPath

      public static final String getWellKnownCredentialsPath()
      Gets the path to the well-known Application Default Credentials file location
      Returns:
      the path to the well-known Application Default Credentials file location
    • getWellKnownCredentialsPath

      static final String getWellKnownCredentialsPath(DefaultCredentialsProvider provider)
      Testing version of getWellKnownCredentialsPath() that uses a custom provider
      Returns:
      the path to the well-known Application Default Credentials file location
    • getWellKnownCredentialsFile

      static final File getWellKnownCredentialsFile(DefaultCredentialsProvider provider)
      Platform-independent logic to obtain the well-known Application Default Credentials file
      Parameters:
      provider - the provider used to resolve env and system properties (exposed for testing purposes)
      Returns:
      the well-known Application Default Credentials file