diff options
author | Alexey Melnikov <alexey.melnikov@isode.com> | 2017-06-19 11:47:27 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2017-07-07 16:10:06 (GMT) |
commit | d89b27b8796f89c847c280dacfb1b09fd6cb6731 (patch) | |
tree | 1014011bf564c665ad27dfafa0dcbe5c4e1db3c4 /Swiften/SASL/EXTERNALClientAuthenticator.cpp | |
parent | 1b678a155adca8957866e016b0e344eee6290466 (diff) | |
download | swift-d89b27b8796f89c847c280dacfb1b09fd6cb6731.zip swift-d89b27b8796f89c847c280dacfb1b09fd6cb6731.tar.bz2 |
Add support for authorization identity in SASL EXTERNAL
As per RFC 4422.
Tested by connecting Harrier configured to use SASL EXTERNAL to M-Box
and verifying that authentication worked as expected.
Also added cppunit test for SASL EXTERNAL.
Change-Id: Ica5c72a858b9d8fcd9197f9c4287ca84e03fcbd2
Diffstat (limited to 'Swiften/SASL/EXTERNALClientAuthenticator.cpp')
-rw-r--r-- | Swiften/SASL/EXTERNALClientAuthenticator.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/SASL/EXTERNALClientAuthenticator.cpp b/Swiften/SASL/EXTERNALClientAuthenticator.cpp index 546140f..027bc89 100644 --- a/Swiften/SASL/EXTERNALClientAuthenticator.cpp +++ b/Swiften/SASL/EXTERNALClientAuthenticator.cpp @@ -12,7 +12,13 @@ EXTERNALClientAuthenticator::EXTERNALClientAuthenticator() : ClientAuthenticator } boost::optional<SafeByteArray> EXTERNALClientAuthenticator::getResponse() const { - return boost::optional<SafeByteArray>(); + const std::string& authorizationID = getAuthorizationID(); + + if (authorizationID.empty()) { + return boost::optional<SafeByteArray>(); + } else { + return createSafeByteArray(authorizationID); + } } bool EXTERNALClientAuthenticator::setChallenge(const boost::optional<ByteArray>&) { |