Comparison

util/sasl/oauthbearer.lua @ 498:50d0bd035bb7

util.sasl.oauthbearer: Don't send authzid It's not needed and not recommended in XMPP unless we want to act as someone other than who we authenticate as. We find out the JID during resource binding.
author Kim Alvefur <zash@zash.se>
date Fri, 23 Jun 2023 12:09:49 +0200
parent 496:c4ae7aa2958a
comparison
equal deleted inserted replaced
497:eb86e3751978 498:50d0bd035bb7
1 1
2 return function (stream, name) 2 return function (stream, name)
3 if name == "OAUTHBEARER" and stream.username then 3 if name == "OAUTHBEARER" then
4 return function (stream) 4 return function (stream)
5 local auth = stream.bearer_token and ("Bearer "..stream.bearer_token) or ""; 5 local auth = stream.bearer_token and ("Bearer "..stream.bearer_token) or "";
6 local message, data = coroutine.yield("n,a="..stream.username.."@"..stream.host..",\001auth="..auth.."\001\001"); 6 local message, data = coroutine.yield("n,,\001auth="..auth.."\001\001");
7 if message == "success" then 7 if message == "success" then
8 return true; 8 return true;
9 elseif message == "challenge" then 9 elseif message == "challenge" then
10 stream:event("oauth-failure", { 10 stream:event("oauth-failure", {
11 json = data; 11 json = data;