Class AppEngineCredentials

    • Field Detail

      • APP_IDENTITY_SERVICE_FACTORY_CLASS

        static final java.lang.String APP_IDENTITY_SERVICE_FACTORY_CLASS
        See Also:
        Constant Field Values
      • APP_IDENTITY_SERVICE_CLASS

        static final java.lang.String APP_IDENTITY_SERVICE_CLASS
        See Also:
        Constant Field Values
      • GET_ACCESS_TOKEN_RESULT_CLASS

        static final java.lang.String GET_ACCESS_TOKEN_RESULT_CLASS
        See Also:
        Constant Field Values
      • SIGNING_RESULT_CLASS

        static final java.lang.String SIGNING_RESULT_CLASS
        See Also:
        Constant Field Values
      • GET_APP_IDENTITY_SERVICE_METHOD

        private static final java.lang.String GET_APP_IDENTITY_SERVICE_METHOD
        See Also:
        Constant Field Values
      • GET_ACCESS_TOKEN_RESULT_METHOD

        private static final java.lang.String GET_ACCESS_TOKEN_RESULT_METHOD
        See Also:
        Constant Field Values
      • GET_ACCESS_TOKEN_METHOD

        private static final java.lang.String GET_ACCESS_TOKEN_METHOD
        See Also:
        Constant Field Values
      • GET_EXPIRATION_TIME_METHOD

        private static final java.lang.String GET_EXPIRATION_TIME_METHOD
        See Also:
        Constant Field Values
      • GET_SERVICE_ACCOUNT_NAME_METHOD

        private static final java.lang.String GET_SERVICE_ACCOUNT_NAME_METHOD
        See Also:
        Constant Field Values
      • SIGN_FOR_APP_METHOD

        private static final java.lang.String SIGN_FOR_APP_METHOD
        See Also:
        Constant Field Values
      • GET_SIGNATURE_METHOD

        private static final java.lang.String GET_SIGNATURE_METHOD
        See Also:
        Constant Field Values
      • scopes

        private final java.util.Collection<java.lang.String> scopes
      • scopesRequired

        private final boolean scopesRequired
      • appIdentityService

        private transient java.lang.Object appIdentityService
      • getAccessToken

        private transient java.lang.reflect.Method getAccessToken
      • getAccessTokenResult

        private transient java.lang.reflect.Method getAccessTokenResult
      • getExpirationTime

        private transient java.lang.reflect.Method getExpirationTime
      • signForApp

        private transient java.lang.reflect.Method signForApp
      • getSignature

        private transient java.lang.reflect.Method getSignature
      • account

        private transient java.lang.String account
    • Constructor Detail

      • AppEngineCredentials

        AppEngineCredentials​(java.util.Collection<java.lang.String> scopes,
                             java.util.Collection<java.lang.String> defaultScopes)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • AppEngineCredentials

        AppEngineCredentials​(java.util.Collection<java.lang.String> scopes,
                             java.util.Collection<java.lang.String> defaultScopes,
                             AppEngineCredentials unscoped)
    • Method Detail

      • init

        private void init()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • refreshAccessToken

        public AccessToken refreshAccessToken()
                                       throws java.io.IOException
        Refresh the access token by getting it from the App Identity service.
        Overrides:
        refreshAccessToken in class OAuth2Credentials
        Returns:
        never
        Throws:
        java.io.IOException
      • createScoped

        public GoogleCredentials createScoped​(java.util.Collection<java.lang.String> scopes)
        Description copied from class: GoogleCredentials
        If the credentials support scopes, creates a copy of the identity with the specified scopes, invalidates the existing scoped access token; otherwise, return the same instance.
        Overrides:
        createScoped in class GoogleCredentials
        Parameters:
        scopes - Collection of scopes to request.
        Returns:
        GoogleCredentials with requested scopes.
      • createScoped

        public GoogleCredentials createScoped​(java.util.Collection<java.lang.String> scopes,
                                              java.util.Collection<java.lang.String> defaultScopes)
        Description copied from class: GoogleCredentials
        If the credentials support scopes, creates a copy of the identity with the specified scopes and default scopes; otherwise, returns the same instance. This is mainly used by client libraries.
        Overrides:
        createScoped in class GoogleCredentials
        Parameters:
        scopes - Collection of scopes to request.
        defaultScopes - Collection of default scopes to request.
        Returns:
        GoogleCredentials with requested scopes.
      • getAccount

        public java.lang.String getAccount()
        Description copied from interface: ServiceAccountSigner
        Returns the service account associated with the signer.
        Specified by:
        getAccount in interface ServiceAccountSigner
        Returns:
        The service account associated with the signer.
      • sign

        public byte[] sign​(byte[] toSign)
        Description copied from interface: ServiceAccountSigner
        Signs the provided bytes using the private key associated with the service account.
        Specified by:
        sign in interface ServiceAccountSigner
        Parameters:
        toSign - bytes to sign
        Returns:
        signed bytes
      • readObject

        private void readObject​(java.io.ObjectInputStream input)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • forName

        java.lang.Class<?> forName​(java.lang.String className)
                            throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException