RefreshingOAuth2CredentialsInterceptor (Cloud Bigtable HBase Client for Java 1.12.0 API)

Class RefreshingOAuth2CredentialsInterceptor

  • java.lang.Object
  • All Implemented Interfaces:

    public class RefreshingOAuth2CredentialsInterceptor
    extends Object
    implements io.grpc.ClientInterceptor
    Client interceptor that authenticates all calls by binding header data provided by a credential. Typically this will populate the Authorization header but other headers may also be filled out.

    Uses the new and simplified Google auth library:

    TODO: COPIED FROM io.grpc.auth.ClientAuthInterceptor. The logic added here for initialization and locking could be moved back to gRPC. This implementation takes advantage of the fact that all of the Bigtable endpoints are OAuth2 based. It uses the OAuth AccessToken to get the token value and next refresh time. The refresh is scheduled asynchronously.

    $Id: $Id
    • Constructor Detail

      • RefreshingOAuth2CredentialsInterceptor

        public RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler,
        Constructor for RefreshingOAuth2CredentialsInterceptor.
        scheduler - a ExecutorService object.
        credentials - a OAuth2Credentials object.
    • Method Detail

      • interceptCall

        public <ReqT,RespT> io.grpc.ClientCall<ReqT,RespT> interceptCall(io.grpc.MethodDescriptor<ReqT,RespT> method,
                                                                         io.grpc.CallOptions callOptions,
                                                                         io.grpc.Channel next)
        Specified by:
        interceptCall in interface io.grpc.ClientInterceptor