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(java.lang.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.java.lang.StringprepareFinalMessage(java.lang.String password, java.lang.String serverFirstMessage)Prepares client's final messagejava.lang.StringprepareFirstMessage(java.lang.String username)Prepares the first client message
-
-
-
Method Detail
-
prepareFirstMessage
java.lang.String prepareFirstMessage(java.lang.String username) throws org.apache.activemq.artemis.spi.core.security.scram.ScramExceptionPrepares the first client message- Parameters:
username- Username of the user- Returns:
- First client message
- Throws:
org.apache.activemq.artemis.spi.core.security.scram.ScramException- if username contains prohibited characters
-
prepareFinalMessage
java.lang.String prepareFinalMessage(java.lang.String password, java.lang.String serverFirstMessage) throws org.apache.activemq.artemis.spi.core.security.scram.ScramExceptionPrepares client's final message- Parameters:
password- User passwordserverFirstMessage- Server's first message- Returns:
- Client's final message
- Throws:
org.apache.activemq.artemis.spi.core.security.scram.ScramException- if there is an error processing server's message, i.e. it violates the protocol
-
checkServerFinalMessage
void checkServerFinalMessage(java.lang.String serverFinalMessage) throws org.apache.activemq.artemis.spi.core.security.scram.ScramExceptionChecks if the server's final message is valid- Parameters:
serverFinalMessage- Server's final message- Throws:
org.apache.activemq.artemis.spi.core.security.scram.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
-
-