Class BasicAuthenticationInformation
java.lang.Object
se.liu.ida.hefquin.federation.authentication.BasicAuthenticationInformation
- All Implemented Interfaces:
AuthenticationInformation
Authentication information for basic authentication.
The username and password are combined into a single string by joining them with a colon and then encoded using Base64.
The resulting value is applied to outgoing HTTP requests using an
Authorization header with the Basic authentication scheme.
This class supports applying the authentication information to different
HTTP request representations used by HeFQUIN.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(HttpRequest.Builder builder) Adds the basic token as an Authorization header to the given HTTP request builder.voidAdds the basic token as an Authorization header to the given HTTP headers.voidapplyTo(org.apache.jena.sparql.exec.http.QueryExecutionHTTPBuilder b) Adds the basic token as an Authorization header to the given HTTP headers.voidChecks that the required username and password are available.
-
Constructor Details
-
BasicAuthenticationInformation
-
-
Method Details
-
getUsername
-
getPassword
-
applyTo
Adds the basic 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 basic 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 basic 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 username and password are available.- Specified by:
checkForCompletenessin interfaceAuthenticationInformation- Throws:
IncompleteAuthenticationInformationError- if the username or password is not available
-