Class ScramSession


  • public class ScramSession
    extends Object
    A class that represents a SCRAM client. Use this class to perform a SCRAM negotiation with a SCRAM server. This class performs an authentication execution for a given user, and has state related to it. Thus, it cannot be shared across users or authentication executions.
    • Constructor Detail

      • ScramSession

        public ScramSession​(ScramMechanism scramMechanism,
                            StringPreparation stringPreparation,
                            String user,
                            String nonce)
        Constructs a SCRAM client, to perform an authentication for a given user. This class can be instantiated directly, but it is recommended that a ScramClient is used instead.
        Parameters:
        scramMechanism - The SCRAM mechanism that will be using this client
        stringPreparation -
        user -
        nonce -
    • Method Detail

      • clientFirstMessage

        public String clientFirstMessage​(Gs2CbindFlag gs2CbindFlag,
                                         String cbindName,
                                         String authzid)
        Returns the text representation of a SCRAM client-first-message, with the GSS-API header values indicated.
        Parameters:
        gs2CbindFlag - The channel binding flag
        cbindName - The channel binding algorithm name, if channel binding is supported, or null
        authzid - The optional
        Returns:
        The message
      • clientFirstMessage

        public String clientFirstMessage()
        Returns the text representation of a SCRAM client-first-message, with no channel binding nor authzid.
        Returns:
        The message