Class GoogleMetadataServerGrant

java.lang.Object
com.codename1.backend.security.oauth2.client.credentials.GoogleMetadataServerGrant
All Implemented Interfaces:
AccessTokenGrant

public final class GoogleMetadataServerGrant extends Object implements AccessTokenGrant
The default service account of the Google Cloud machine this server runs on -- Compute Engine, Cloud Run, GKE, App Engine -- as an AccessTokenGrant, read from the metadata server. The fallback every Google client uses when no key file is configured.
  • Constructor Details

    • GoogleMetadataServerGrant

      public GoogleMetadataServerGrant()
  • Method Details

    • fetch

      public AccessToken fetch()
      Description copied from interface: AccessTokenGrant
      Exchanges the credentials for a new token.
      Specified by:
      fetch in interface AccessTokenGrant
    • serviceAccountEmail

      public static String serviceAccountEmail() throws IOException
      The e-mail address of the machine's service account, which is what a signature made through the IAM signBlob call is attributed to.
      Throws:
      IOException - when the metadata server does not answer