Class RefreshingOAuth2CredentialsInterceptor
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.io.RefreshingOAuth2CredentialsInterceptor
-
- All Implemented Interfaces:
- io.grpc.ClientInterceptor
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: https://github.com/google/google-auth-library-java
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.
- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Constructor Summary
Constructors Constructor and Description RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler, com.google.auth.oauth2.OAuth2Credentials credentials)
Constructor for RefreshingOAuth2CredentialsInterceptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description <ReqT,RespT>
io.grpc.ClientCall<ReqT,RespT>interceptCall(io.grpc.MethodDescriptor<ReqT,RespT> method, io.grpc.CallOptions callOptions, io.grpc.Channel next)
-
-
-
Constructor Detail
-
RefreshingOAuth2CredentialsInterceptor
public RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler, com.google.auth.oauth2.OAuth2Credentials credentials)
Constructor for RefreshingOAuth2CredentialsInterceptor.- Parameters:
scheduler
- aExecutorService
object.credentials
- aOAuth2Credentials
object.
-
-