Class OAuthCredentialsProvider
- java.lang.Object
-
- io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProvider
-
- All Implemented Interfaces:
CredentialsProvider
public final class OAuthCredentialsProvider extends Object implements CredentialsProvider
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyCredentials(io.grpc.Metadata headers)
Adds an access token to the Authorization header of a gRPC call.boolean
shouldRetryRequest(Throwable throwable)
Returns true if the Throwable was caused by an UNAUTHENTICATED response and a new access token could be fetched; otherwise returns false.
-
-
-
Method Detail
-
applyCredentials
public void applyCredentials(io.grpc.Metadata headers) throws IOException
Adds an access token to the Authorization header of a gRPC call.- Specified by:
applyCredentials
in interfaceCredentialsProvider
- Parameters:
headers
- gRPC headers to be modified- Throws:
IOException
-
shouldRetryRequest
public boolean shouldRetryRequest(Throwable throwable)
Returns true if the Throwable was caused by an UNAUTHENTICATED response and a new access token could be fetched; otherwise returns false.- Specified by:
shouldRetryRequest
in interfaceCredentialsProvider
- Parameters:
throwable
- error that caused the request to fail
-
-