MongoDB C++ Driver
legacy-1.1.2
|
Implementation of the client side of a SASL authentication conversation. More...
#include <cyrus_sasl_client_session.h>
Public Member Functions | |
virtual void | setParameter (Parameter id, const StringData &value) |
Overriding to store the password data in sasl_secret_t format. | |
sasl_secret_t * | getPasswordAsSecret () |
Returns the value of the parameterPassword parameter in the form of a sasl_secret_t, used by the Cyrus SASL library's SASL_CB_PASS callback. More... | |
virtual Status | initialize () |
Initializes a session for use. More... | |
virtual Status | step (const StringData &inputData, std::string *outputData) |
Takes one step of the SASL protocol on behalf of the client. More... | |
virtual bool | isDone () const |
Returns true if the authentication completed successfully. | |
Public Member Functions inherited from mongo::SaslClientSession | |
virtual bool | hasParameter (Parameter id) |
Returns true if "id" identifies a parameter previously set by a call to setParameter(). | |
virtual StringData | getParameter (Parameter id) |
Returns the value of a previously set parameter. More... | |
Additional Inherited Members | |
Public Types inherited from mongo::SaslClientSession | |
enum | Parameter |
Identifiers of parameters used to configure a SaslClientSession. | |
Implementation of the client side of a SASL authentication conversation.
using the Cyrus SASL library.
sasl_secret_t* mongo::CyrusSaslClientSession::getPasswordAsSecret | ( | ) |
Returns the value of the parameterPassword parameter in the form of a sasl_secret_t, used by the Cyrus SASL library's SASL_CB_PASS callback.
The session object owns the storage referenced by the returned sasl_secret_t*, which will remain in scope according to the same rules as given for SaslClientSession::getParameter().
|
virtual |
Initializes a session for use.
Call exactly once, after setting any parameters you intend to set via setParameter().
Implements mongo::SaslClientSession.
|
virtual |
Takes one step of the SASL protocol on behalf of the client.
Caller should provide data from the server side of the conversation in "inputData", or an empty StringData() if none is available. If the client should make a response to the server, stores the response into "*outputData".
Returns Status::OK() on success. Any other return value indicates a failed authentication, though the specific return value may provide insight into the cause of the failure (e.g., ProtocolError, AuthenticationFailed).
In the event that this method returns Status::OK(), consult the value of isDone() to determine if the conversation has completed. When step() returns Status::OK() and isDone() returns true, authentication has completed successfully.
Implements mongo::SaslClientSession.