|
E-MailRelay
|
An interface for implementing the server-side SASL challenge/response concept. More...
#include <gsaslserver.h>
Inheritance diagram for GAuth::SaslServer:Public Member Functions | |
| virtual | ~SaslServer () |
| Destructor. | |
| virtual bool | requiresEncryption () const =0 |
| Returns true if the implementation requires that the challenge/response dialog should only take place over an encrypted transport. More... | |
| virtual bool | active () const =0 |
| Returns true if the constructor's "secrets" object was valid. More... | |
| virtual std::string | mechanisms (char sep= ' ') const =0 |
| Returns a list of supported, standard mechanisms that can be advertised to the client. More... | |
| virtual bool | init (const std::string &mechanism)=0 |
| Initialiser. More... | |
| virtual std::string | mechanism () const =0 |
| Returns the mechanism, as passed to the last init() call to return true. More... | |
| virtual bool | mustChallenge () const =0 |
| Returns true if authentication using the current mechanism must always start with a non-empty server challenge, ie. More... | |
| virtual std::string | initialChallenge () const =0 |
| Returns the initial server challenge. More... | |
| virtual std::string | apply (const std::string &response, bool &done)=0 |
| Applies the client response and returns the next challenge. More... | |
| virtual bool | authenticated () const =0 |
| Returns true if authenticated sucessfully. More... | |
| virtual std::string | id () const =0 |
| Returns the authenticated or trusted identity. More... | |
| virtual bool | trusted (const GNet::Address &) const =0 |
| Returns true if a trusted client that does not need to authenticate. More... | |
An interface for implementing the server-side SASL challenge/response concept.
Third-party libraries could be plumbed in at this interface in order to get support for more exotic authentication mechanisms. In practice there is one derived class for basic authentication mechanisms using a secrets file, and another for PAM.
Usage:
Definition at line 67 of file gsaslserver.h.
|
pure virtual |
Returns true if the constructor's "secrets" object was valid.
See also Secrets::valid().
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Applies the client response and returns the next challenge.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns true if authenticated sucessfully.
Precondition: apply() returned empty
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns the authenticated or trusted identity.
Returns the empty string if not authenticated and not trusted.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Initialiser.
Returns true if the mechanism is in the mechanisms() list, or if it is some other supported mechanism (like "APOP") that the derived-class object allows implicitly. May be used more than once. The initialChallenge() is re-initialised.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns the initial server challenge.
May return an empty string.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns the mechanism, as passed to the last init() call to return true.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns a list of supported, standard mechanisms that can be advertised to the client.
Some mechanisms (like "APOP") may be accepted by init() even though they are not advertised.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns true if authentication using the current mechanism must always start with a non-empty server challenge, ie.
it is a "server-first" mechanism as per RFC-4422.
Returns false for the "LOGIN" mechanism since the initial challenge ("Username:") is not essential, ie. it is a "variable" mechanism.
The server should call initialChallenge() to decide whether to send an initial challenge; this method is only to stop a client providing an initial response before an initial challenge has been sent.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns true if the implementation requires that the challenge/response dialog should only take place over an encrypted transport.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
|
pure virtual |
Returns true if a trusted client that does not need to authenticate.
Implemented in GAuth::SaslServerPam, and GAuth::SaslServerBasic.
1.8.9.1