Mercurial > prosody-modules
view mod_proxy65_whitelist/mod_proxy65_whitelist.lua @ 5643:73c3d5bfce3e
mod_http_oauth2: Allow 'login_hint' as a substitute for OIDC 'select_account' prompt
If the OIDC 'prompt' parameter does not contain the 'select_account'
then it wants us to skip account selection, which means we have to
figure which account to authenticate somehow. One way could be have
this stored in a cookie from a previous successful login. Another way
would be to have the account passed as a hint, which is what we add
here.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 09 Sep 2023 21:42:24 +0200 |
parents | f96b947303a2 |
children |
line wrap: on
line source
local allowed_streamhosts = module:get_option_set("allowed_streamhosts", {}); -- eg proxy.eu.jabber.org if module:get_option_boolean("allow_local_streamhosts", true) then for hostname, host in pairs(hosts) do if host.modules.proxy65 then allowed_streamhosts:add(hostname); end end module:hook_global("host-activated", function (host) if hosts[host].modules.proxy65 then allowed_streamhosts:add(host); end end); end local function filter_streamhosts(tag) if tag.name == "streamhost" and not allowed_streamhosts:contains(tag.attr.jid) then return nil; end return tag; end module:hook("iq/full", function (event) local stanza = event.stanza; if stanza.attr.type == "set" then local payload = stanza:get_child("query", "http://jabber.org/protocol/bytestreams"); if payload then payload:maptags(filter_streamhosts); end end end, 1);