Class AuthenticationMaterial

  • All Implemented Interfaces:
    AuthMaterial

    public class AuthenticationMaterial
    extends Object
    implements AuthMaterial

    An instance of AuthenticationMaterial serves to establish a user based Session with the webPDF server.
    It shall both provide UsernamePasswordCredentials for a user, and a proper authorization Header to communicate the authentication attempt to the server.

    • Constructor Detail

      • AuthenticationMaterial

        public AuthenticationMaterial​(@NotNull
                                      @NotNull String user,
                                      char @NotNull [] password)

        Instantiates fresh AuthenticationMaterial for 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´s UsernamePasswordCredentials.
        Specified by:
        getCredentials in interface AuthMaterial
        Returns:
        The user´s UsernamePasswordCredentials.
      • getToken

        @NotNull
        public @NotNull String getToken()
        Returns the raw String token, that shall be passed to the authorization Header.
        Specified by:
        getToken in interface AuthMaterial
        Returns:
        The raw String token, that shall be passed to the authorization Header.