Class TokenBasedAuthenticationInformation
java.lang.Object
se.liu.ida.hefquin.federation.authentication.TokenBasedAuthenticationInformation
- All Implemented Interfaces:
AuthenticationInformation
public class TokenBasedAuthenticationInformation
extends Object
implements AuthenticationInformation
Authentication information for token-based authentication.
The token is applied to outgoing HTTP requests using an
Authorization header with the configured authentication scheme.
This class supports applying the authentication information to different
HTTP request representations used by HeFQUIN.
-
Constructor Summary
ConstructorsConstructorDescriptionTokenBasedAuthenticationInformation(String authenticationScheme, String token) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(HttpRequest.Builder builder) Adds the authentication scheme and token as an Authorization header to the given HTTP request builder.voidAdds the authentication scheme and token as an Authorization header to the given HTTP headers.voidapplyTo(org.apache.jena.sparql.exec.http.QueryExecutionHTTPBuilder b) Adds the authentication scheme and token as an Authorization header to the given HTTP headers.voidChecks that the required token is available.getToken()
-
Constructor Details
-
TokenBasedAuthenticationInformation
-
-
Method Details
-
getAuthenticationScheme
-
getToken
-
applyTo
Adds the authentication scheme and token as an Authorization header to the given HTTP request builder.- Specified by:
applyToin interfaceAuthenticationInformation- Parameters:
builder- HTTP request builder to which the Authorization header is added
-
applyTo
Adds the authentication scheme and token as an Authorization header to the given HTTP headers.- Specified by:
applyToin interfaceAuthenticationInformation- Parameters:
headers- HTTP headers to which the Authorization header is added
-
applyTo
public void applyTo(org.apache.jena.sparql.exec.http.QueryExecutionHTTPBuilder b) Adds the authentication scheme and token as an Authorization header to the given HTTP headers.- Specified by:
applyToin interfaceAuthenticationInformation- Parameters:
b- QueryExecutionHTTPBuilder to which the Authorization header is added
-
checkForCompleteness
Checks that the required token is available.- Specified by:
checkForCompletenessin interfaceAuthenticationInformation- Throws:
IncompleteAuthenticationInformationError- if the token is not available
-