Class HttpBearerAuth
java.lang.Object
co.ankatech.keymanagement.client.auth.invoker.auth.HttpBearerAuth
- All Implemented Interfaces:
Authentication
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class HttpBearerAuth
extends Object
implements Authentication
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) Apply authentication settings to header and query params.voidClears the stored bearer token by setting the internal reference tonull.Gets the token, which together with the scheme, will be sent as the value of the Authorization header.voidsetBearerToken(String bearerToken) Sets the token, which together with the scheme, will be sent as the value of the Authorization header.voidsetBearerToken(Supplier<String> tokenSupplier) Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
-
Constructor Details
-
HttpBearerAuth
-
-
Method Details
-
getBearerToken
Gets the token, which together with the scheme, will be sent as the value of the Authorization header.- Returns:
- The bearer token
-
setBearerToken
Sets the token, which together with the scheme, will be sent as the value of the Authorization header.The token is stored in an internal
AtomicReferencesoclearBearerToken()can later release it. The supplier reads from the reference, NOT from a captured local variable.- Parameters:
bearerToken- The bearer token to send in the Authorization header
-
clearBearerToken
public void clearBearerToken()Clears the stored bearer token by setting the internal reference tonull. After this call,getBearerToken()returnsnulland outgoing requests receive noAuthorizationheader.Call it to release the token once it is no longer in use.
-
setBearerToken
Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.- Parameters:
tokenSupplier- The supplier of bearer tokens to send in the Authorization header
-
applyToParams
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, throws ApiExceptionString> cookieParams, String payload, String method, URI uri) Description copied from interface:AuthenticationApply authentication settings to header and query params.- Specified by:
applyToParamsin interfaceAuthentication- Parameters:
queryParams- List of query parametersheaderParams- Map of header parameterscookieParams- Map of cookie parameterspayload- HTTP request bodymethod- HTTP methoduri- URI- Throws:
ApiException- if failed to update the parameters
-