diff options
author | Ted Ross <tross@apache.org> | 2008-11-13 22:04:59 +0000 |
---|---|---|
committer | Ted Ross <tross@apache.org> | 2008-11-13 22:04:59 +0000 |
commit | fde0d6af59f7ff8d958c56aab6d57be3b491222a (patch) | |
tree | 15e7f08a879b5809d878ffd3e61b30aaa1b5b487 /cpp/src/qpid/broker/SaslAuthenticator.cpp | |
parent | 0272430b4dd7ad2f05492d527d5f5f1bb50e7356 (diff) | |
download | qpid-python-fde0d6af59f7ff8d958c56aab6d57be3b491222a.tar.gz |
QPID-1461 - Added qmf event support for connections.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@713838 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SaslAuthenticator.cpp')
-rw-r--r-- | cpp/src/qpid/broker/SaslAuthenticator.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/SaslAuthenticator.cpp b/cpp/src/qpid/broker/SaslAuthenticator.cpp index c8c447e97b..6c6ddd63cb 100644 --- a/cpp/src/qpid/broker/SaslAuthenticator.cpp +++ b/cpp/src/qpid/broker/SaslAuthenticator.cpp @@ -70,6 +70,8 @@ public: void getMechanisms(framing::Array& mechanisms); void start(const std::string& mechanism, const std::string& response); void step(const std::string& response); + void getUid(std::string& uid); + void getError(std::string& error); }; bool SaslAuthenticator::available(void) @@ -202,6 +204,23 @@ CyrusAuthenticator::~CyrusAuthenticator() } } +void CyrusAuthenticator::getError(string& error) +{ + error = string(sasl_errdetail(sasl_conn)); +} + +void CyrusAuthenticator::getUid(string& uid) +{ + int code; + const void* ptr; + + code = sasl_getprop(sasl_conn, SASL_USERNAME, &ptr); + if (SASL_OK != code) + return; + + uid = string(const_cast<char*>(static_cast<const char*>(ptr))); +} + void CyrusAuthenticator::getMechanisms(Array& mechanisms) { const char *separator = " "; |