Class JwtCredentials

java.lang.Object
com.google.auth.Credentials
com.google.auth.oauth2.JwtCredentials
All Implemented Interfaces:
JwtProvider, Serializable

public class JwtCredentials extends Credentials implements JwtProvider
Credentials class for calling Google APIs using a JWT with custom claims.

Uses a JSON Web Token (JWT) directly in the request metadata to provide authorization.


 JwtClaims claims = JwtClaims.newBuilder()
     .setAudience("https://example.com/some-audience")
     .setIssuer("some-issuer@example.com")
     .setSubject("some-subject@example.com")
     .build();
 Credentials = JwtCredentials.newBuilder()
     .setPrivateKey(privateKey)
     .setPrivateKeyId("private-key-id")
     .setJwtClaims(claims)
     .build();
 
See Also: