Class AuthenticationMaterial
- java.lang.Object
-
- net.webpdf.wsclient.session.auth.material.AuthenticationMaterial
-
- All Implemented Interfaces:
AuthMaterial
public class AuthenticationMaterial extends Object implements AuthMaterial
An instance of
AuthenticationMaterialserves to establish a user basedSessionwith the webPDF server.
It shall both provideUsernamePasswordCredentialsfor a user, and a proper authorizationHeaderto communicate the authentication attempt to the server.
-
-
Constructor Summary
Constructors Constructor Description AuthenticationMaterial(@NotNull String user, char @NotNull [] password)Instantiates freshAuthenticationMaterialfor the given user, using the given password.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable org.apache.hc.client5.http.auth.CredentialsgetCredentials()Returns the user´sUsernamePasswordCredentials.@Nullable StringgetRawAuthHeader()Returns a newAuthMethod.BASIC_AUTHORIZATIONheader using the givenUsernamePasswordCredentials.@NotNull StringgetToken()Returns the raw String token, that shall be passed to the authorizationHeader.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.webpdf.wsclient.session.auth.material.AuthMaterial
getAuthHeader
-
-
-
-
Constructor Detail
-
AuthenticationMaterial
public AuthenticationMaterial(@NotNull @NotNull String user, char @NotNull [] password)Instantiates fresh
AuthenticationMaterialfor the given user, using the given password.- Parameters:
user- The username to authenticate.password- The password of the authenticated user.
-
-
Method Detail
-
getCredentials
@Nullable public @Nullable org.apache.hc.client5.http.auth.Credentials getCredentials()
Returns the user´sUsernamePasswordCredentials.- Specified by:
getCredentialsin interfaceAuthMaterial- Returns:
- The user´s
UsernamePasswordCredentials.
-
getRawAuthHeader
@Nullable public @Nullable String getRawAuthHeader()
Returns a newAuthMethod.BASIC_AUTHORIZATIONheader using the givenUsernamePasswordCredentials.- Specified by:
getRawAuthHeaderin interfaceAuthMaterial- Returns:
- A new
AuthMethod.BASIC_AUTHORIZATIONheader using the givenUsernamePasswordCredentials.
-
getToken
@NotNull public @NotNull String getToken()
Returns the raw String token, that shall be passed to the authorizationHeader.- Specified by:
getTokenin interfaceAuthMaterial- Returns:
- The raw String token, that shall be passed to the authorization
Header.
-
-