diff options
author | Alan Conway <aconway@apache.org> | 2008-05-20 13:44:34 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-05-20 13:44:34 +0000 |
commit | 0333573627c831142aa251bfb1cabdb1e2bf438e (patch) | |
tree | 953bf8c624374c57953aa3f2888254d175609d9a /cpp/src/qpid/broker/SaslAuthenticator.cpp | |
parent | 96024622ccfcc8fdd24b3c9ace44f7c8849fac46 (diff) | |
download | qpid-python-0333573627c831142aa251bfb1cabdb1e2bf438e.tar.gz |
Support for AMQP 0-10 sessions in C++ broker.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@658246 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SaslAuthenticator.cpp')
-rw-r--r-- | cpp/src/qpid/broker/SaslAuthenticator.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/SaslAuthenticator.cpp b/cpp/src/qpid/broker/SaslAuthenticator.cpp index d48b258ba2..a542211147 100644 --- a/cpp/src/qpid/broker/SaslAuthenticator.cpp +++ b/cpp/src/qpid/broker/SaslAuthenticator.cpp @@ -89,13 +89,20 @@ void NullAuthenticator::getMechanisms(Array& mechanisms) mechanisms.add(boost::shared_ptr<FieldValue>(new Str16Value("ANONYMOUS"))); } -void NullAuthenticator::start(const string& /*mechanism*/, const string& /*response*/) +void NullAuthenticator::start(const string& mechanism, const string& response) { QPID_LOG(warning, "SASL: No Authentication Performed"); - - // TODO: Figure out what should actually be set in this case - connection.setUserId("anonymous"); - + if (mechanism == "PLAIN") { // Old behavior + if (response.size() > 0 && response[0] == (char) 0) { + string temp = response.substr(1); + string::size_type i = temp.find((char)0); + string uid = temp.substr(0, i); + string pwd = temp.substr(i + 1); + connection.setUserId(uid); + } + } else { + connection.setUserId("anonymous"); + } client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0); } |