Class TokenCredential.Builder

    • Method Detail

      • token

        public TokenCredential.Builder token​(String token)
        Set the token content (the actual string travelling on the network).
        Parameters:
        token - token value
        Returns:
        updated builder instance
      • issueTime

        public TokenCredential.Builder issueTime​(Instant issueTime)
        Time the token was issued.
        Parameters:
        issueTime - issue instant
        Returns:
        updated builder instance
      • expTime

        public TokenCredential.Builder expTime​(Instant expirationTime)
        Time the token would expire.
        Parameters:
        expirationTime - expiration instant
        Returns:
        updated builder instance
      • issuer

        public TokenCredential.Builder issuer​(String issuer)
        Issuer of the token.
        Parameters:
        issuer - issuer (such as accounts.google.com)
        Returns:
        updated builder instance
      • addToken

        public <T,​U extends T> TokenCredential.Builder addToken​(Class<T> tokenClass,
                                                                      U tokenInstance)
        Add a token instance (such as JWT instance). May contain more than one instance (e.g. for JWT, we may send both SignedJwt and Jwt).
        Type Parameters:
        T - type of instance
        U - type of class to register instance by
        Parameters:
        tokenClass - class we want to register the instance under
        tokenInstance - instance
        Returns:
        updated builder instance
      • addToken

        public TokenCredential.Builder addToken​(Object token)
        Add a token instance (such as JWT instance). May contain more than one instance (e.g. for JWT, we may send both SignedJwt and Jwt). Object is registered under the class it provides through Object.getClass().
        Parameters:
        token - instance
        Returns:
        updated builder instance