Package org.apache.arrow.flight.auth2
Class BearerTokenAuthenticator
java.lang.Object
org.apache.arrow.flight.auth2.BearerTokenAuthenticator
- All Implemented Interfaces:
CallHeaderAuthenticator
- Direct Known Subclasses:
GeneratedBearerTokenAuthenticator
Partial implementation of
CallHeaderAuthenticator
for bearer-token based authentication.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.arrow.flight.auth2.CallHeaderAuthenticator
CallHeaderAuthenticator.AuthResult
-
Field Summary
Fields inherited from interface org.apache.arrow.flight.auth2.CallHeaderAuthenticator
NO_OP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(CallHeaders incomingHeaders) Validate the auth headers sent by the client.protected abstract CallHeaderAuthenticator.AuthResult
Callback to run when the initial authenticator succeeds.protected abstract CallHeaderAuthenticator.AuthResult
validateBearer
(String bearerToken) Validate the bearer token.
-
Constructor Details
-
BearerTokenAuthenticator
-
-
Method Details
-
authenticate
Description copied from interface:CallHeaderAuthenticator
Validate the auth headers sent by the client.- Specified by:
authenticate
in interfaceCallHeaderAuthenticator
- Parameters:
incomingHeaders
- The incoming headers to authenticate.- Returns:
- an auth result containing a peer identity and optionally a bearer token.
-
getAuthResultWithBearerToken
protected abstract CallHeaderAuthenticator.AuthResult getAuthResultWithBearerToken(CallHeaderAuthenticator.AuthResult authResult) Callback to run when the initial authenticator succeeds.- Parameters:
authResult
- A successful initial authentication result.- Returns:
- an alternate AuthResult based on the original AuthResult that will write a bearer token to output headers.
-
validateBearer
Validate the bearer token.- Parameters:
bearerToken
- The bearer token to validate.- Returns:
- A successful AuthResult if validation succeeded.
-