Interface ScramClientFunctionality

  • All Known Implementing Classes:
    ScramClientFunctionalityImpl

    public interface ScramClientFunctionality
    Provides building blocks for creating SCRAM authentication client
    • Method Detail

      • prepareFirstMessage

        String prepareFirstMessage​(String username)
                            throws ScramException
        Prepares the first client message
        Parameters:
        username - Username of the user
        Returns:
        First client message
        Throws:
        ScramException - if username contains prohibited characters
      • prepareFinalMessage

        String prepareFinalMessage​(String password,
                                   String serverFirstMessage)
                            throws ScramException
        Prepares client's final message
        Parameters:
        password - User password
        serverFirstMessage - Server's first message
        Returns:
        Client's final message
        Throws:
        ScramException - if there is an error processing server's message, i.e. it violates the protocol
      • checkServerFinalMessage

        void checkServerFinalMessage​(String serverFinalMessage)
                              throws ScramException
        Checks if the server's final message is valid
        Parameters:
        serverFinalMessage - Server's final message
        Throws:
        ScramException - if there is an error processing server's message, i.e. it violates the protocol
      • isSuccessful

        boolean isSuccessful()
        Checks if authentication is successful. You can call this method only if authentication is completed. Ensure that using isEnded()
        Returns:
        true if successful, false otherwise
      • isEnded

        boolean isEnded()
        Checks if authentication is completed, either successfully or not. Authentication is completed if getState() returns ENDED.
        Returns:
        true if authentication has ended