public class RefreshingOAuth2CredentialsInterceptor extends Object implements io.grpc.ClientInterceptor
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.
Constructor and Description |
---|
RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler,
com.google.auth.oauth2.OAuth2Credentials credentials)
Constructor for RefreshingOAuth2CredentialsInterceptor.
|
Modifier and Type | Method and Description |
---|---|
<ReqT,RespT> |
interceptCall(io.grpc.MethodDescriptor<ReqT,RespT> method,
io.grpc.CallOptions callOptions,
io.grpc.Channel next) |
public RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler, com.google.auth.oauth2.OAuth2Credentials credentials)
Constructor for RefreshingOAuth2CredentialsInterceptor.
scheduler
- a ExecutorService
object.credentials
- a OAuth2Credentials
object.