summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/SaslAuthenticator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/SaslAuthenticator.cpp')
-rw-r--r--cpp/src/qpid/broker/SaslAuthenticator.cpp19
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 = " ";