# HG changeset patch # User Kim Alvefur # Date 1683716113 -7200 # Node ID 49306afbf72222ce378fc3802e27dbcfb54f328d # Parent e7d99bacd0e8ab0aa4347d08e7f5bfa2e5dedc36 mod_auth_oauth_external: Expect XEP-0106 escaped username in PLAIN This allows entering an email address as username in some clients by escaping the @ as \40, enabling authentication against Mastodon diff -r e7d99bacd0e8 -r 49306afbf722 mod_auth_oauth_external/mod_auth_oauth_external.lua --- a/mod_auth_oauth_external/mod_auth_oauth_external.lua Wed May 10 12:39:05 2023 +0200 +++ b/mod_auth_oauth_external/mod_auth_oauth_external.lua Wed May 10 12:55:13 2023 +0200 @@ -37,6 +37,7 @@ if token_endpoint and allow_plain then local map_username = function (username, _realm) return username; end; --jid.join; -- TODO configurable function profile:plain_test(username, password, realm) + username = jid.unescape(username); -- COMPAT Mastodon local tok, err = async.wait_for(self.profile.http_client:request(token_endpoint, { headers = { ["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8"; ["Accept"] = "application/json" }; body = http.formencode({