Class OAuthCredentials


  • public class OAuthCredentials
    extends io.grpc.CallCredentials
    OAuthCredentials uses a OAuth OIDC ID token making authenticated gRPC calls. Makes an OAuth request to obtain the OIDC token used for authentication. The given token will be passed as authorization bearer token when making calls.
    • Constructor Detail

      • OAuthCredentials

        public OAuthCredentials​(Map<String,​String> options)
        Constructs a new OAuthCredentials with given options.
        Parameters:
        options - a map of options, Required unless specified: grant_type - OAuth grant type. Should be set as client_credentials audience - Sets the target audience of the token obtained. client_id - Client id to use in the OAuth request. client_secret - Client securet to use in the OAuth request. jwtEndpointURI - HTTPS URL used to retrieve a JWK that can be used to decode the credential.
    • Method Detail

      • thisUsesUnstableApi

        public void thisUsesUnstableApi()
        Specified by:
        thisUsesUnstableApi in class io.grpc.CallCredentials
      • applyRequestMetadata

        public void applyRequestMetadata​(io.grpc.CallCredentials.RequestInfo requestInfo,
                                         Executor appExecutor,
                                         io.grpc.CallCredentials.MetadataApplier applier)
        Specified by:
        applyRequestMetadata in class io.grpc.CallCredentials