Interface ScramClientFunctionality
-
- All Known Implementing Classes:
ScramClientFunctionalityImpl
public interface ScramClientFunctionalityProvides building blocks for creating SCRAM authentication client
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classScramClientFunctionality.StateState of the authentication procedure
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckServerFinalMessage(String serverFinalMessage)Checks if the server's final message is validScramClientFunctionality.StategetState()Gets the state of the authentication procedurebooleanisEnded()Checks if authentication is completed, either successfully or not.booleanisSuccessful()Checks if authentication is successful.StringprepareFinalMessage(String password, String serverFirstMessage)Prepares client's final messageStringprepareFirstMessage(String username)Prepares the first client message
-
-
-
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 passwordserverFirstMessage- 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 usingisEnded()- Returns:
- true if successful, false otherwise
-
isEnded
boolean isEnded()
Checks if authentication is completed, either successfully or not. Authentication is completed ifgetState()returns ENDED.- Returns:
- true if authentication has ended
-
getState
ScramClientFunctionality.State getState()
Gets the state of the authentication procedure- Returns:
- Current state
-
-