MongoDB C++ Driver legacy-1.1.2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mongo::CyrusSaslClientSession Class Reference

Implementation of the client side of a SASL authentication conversation. More...

#include <cyrus_sasl_client_session.h>

+ Inheritance diagram for mongo::CyrusSaslClientSession:

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.
 
virtual Status initialize ()
 Initializes a session for use.
 
virtual Status step (const StringData &inputData, std::string *outputData)
 Takes one step of the SASL protocol on behalf of the client.
 
virtual bool isDone () const
 Returns true if the authentication completed successfully.
 
- Public Member Functions inherited from mongo::SaslClientSession
virtual void setParameter (Parameter id, const StringData &value)
 Sets the parameter identified by "id" to "value".
 
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.
 
virtual Status initialize ()=0
 Initializes a session for use.
 
virtual Status step (const StringData &inputData, std::string *outputData)=0
 Takes one step of the SASL protocol on behalf of the client.
 
virtual bool isDone () const =0
 Returns true if the authentication completed successfully.
 

Additional Inherited Members

- Public Types inherited from mongo::SaslClientSession
enum  Parameter
 Identifiers of parameters used to configure a SaslClientSession.
 

Detailed Description

Implementation of the client side of a SASL authentication conversation.

using the Cyrus SASL library.

Member Function Documentation

◆ getPasswordAsSecret()

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().

◆ initialize()

virtual Status mongo::CyrusSaslClientSession::initialize ( )
virtual

Initializes a session for use.

Call exactly once, after setting any parameters you intend to set via setParameter().

Implements mongo::SaslClientSession.

◆ step()

virtual Status mongo::CyrusSaslClientSession::step ( const StringData inputData,
std::string *  outputData 
)
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.


The documentation for this class was generated from the following file: