@InternalApi(value="For internal usage only") public class CredentialInterceptorCache extends Object
RefreshingOAuth2CredentialsInterceptor
for
default authorization cases. In other types of authorization, such as file based Credentials, it
will create a new one.
For internal use only - public for technical reasons.
Modifier and Type | Method and Description |
---|---|
io.grpc.ClientInterceptor |
getCredentialsInterceptor(CredentialOptions credentialOptions,
RetryOptions retryOptions)
Given
CredentialOptions that define how to look up
credentials, do the following:
Look up the credentials
If there are credentials, create a gRPC interceptor that gets OAuth2 security tokens and
add that token as a header on all calls. |
static CredentialInterceptorCache |
getInstance()
Getter for the field
instance . |
public static CredentialInterceptorCache getInstance()
instance
.CredentialInterceptorCache
object.public io.grpc.ClientInterceptor getCredentialsInterceptor(CredentialOptions credentialOptions, RetryOptions retryOptions) throws IOException, GeneralSecurityException
CredentialOptions
that define how to look up
credentials, do the following:
RefreshingOAuth2CredentialsInterceptor
ensures that the token stays fresh. It does token lookups asynchronously so that the
calls themselves take as little performance penalty as possible.
CredentialOptions
uses
default application credentials
credentialOptions
- Defines how credentials should be achievedretryOptions
- a RetryOptions
object.IOException
- if any.GeneralSecurityException
- if any.