com.exasol.bucketfs.jsonrpc.BearerTokenAuthenticator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bucketfs-java Show documentation
Show all versions of bucketfs-java Show documentation
Java library for automating tasks on Exasol's BucketFS.
The newest version!
package com.exasol.bucketfs.jsonrpc;
import java.net.http.HttpRequest;
/**
* Authenticate an HTTP request via a bearer token.
*/
class BearerTokenAuthenticator implements Authenticator {
private final String token;
BearerTokenAuthenticator(final String token) {
this.token = token;
}
@Override
public void authenticate(final HttpRequest.Builder requestBuilder) {
requestBuilder.header("Authorization", "Bearer " + this.token);
}
}