36 bool init(
const std::string & mechanism ) ;
37 bool authenticated(
const std::string & ,
const std::string & ) ;
40 std::string
id()
const ;
46 std::auto_ptr<GAuth::SaslServer> m_sasl ;
53 m_sasl(
GAuth::SaslServerFactory::newSaslServer(secrets,true,false))
55 m_sasl->init(
"APOP" ) ;
60 return m_secrets.valid() && m_sasl->active() ;
65 G_DEBUG(
"GPop::AuthImp::init: mechanism " << mechanism ) ;
66 return m_sasl->init(mechanism) ;
72 std::string challenge_1 = m_sasl->apply( p1 , done_1 ) ;
75 return challenge_1.empty() && m_sasl->authenticated() ;
80 std::string challenge_2 = m_sasl->apply( p2 , done_2 ) ;
81 return done_2 && challenge_2.empty() && m_sasl->authenticated() ;
87 return m_sasl->mustChallenge() ;
92 return m_sasl->initialChallenge() ;
102 return m_sasl->mechanisms() ;
107 return m_sasl->requiresEncryption() ;
124 return m_imp->valid() ;
129 return m_imp->init(mechanism) ;
134 return m_imp->authenticated(p1,p2) ;
139 return m_imp->mustChallenge() ;
144 return m_imp->challenge() ;
154 return m_imp->mechanisms() ;
159 return m_imp->sensitive() ;
A simple interface to a store of secrets as used in authentication.
std::string mechanisms() const
Returns a space-separated list of standard, supported SASL mechanisms (so not including APOP)...
std::string mechanisms() const
bool mustChallenge() const
Returns true if the init()ialised mechanism requires an initial challenge.
bool init(const std::string &mechanism)
Initialises or reinitialises with the specified mechanism.
std::string challenge()
Returns an initial challenge appropriate to the current mechanism.
std::string id() const
Returns the authenticated user id.
bool sensitive() const
Returns true if the implementation requires authentication to be restricted to encrypted transports...
bool authenticated(const std::string &rsp1, const std::string &rsp2)
Authenticates a one-step (APOP,PLAIN) or two-step (LOGIN) challenge-response sequence.
bool init(const std::string &mechanism)
A private pimple-pattern implementation class used by GPop::Auth.
bool valid() const
Returns true if the secrets are valid.
SASL authentication classes.
bool authenticated(const std::string &, const std::string &)
bool mustChallenge() const
Auth(const Secrets &)
Constructor.