annotate mod_extdisco/README.markdown @ 5193:2bb29ece216b

mod_http_oauth2: Implement stateless dynamic client registration Replaces previous explicit registration that required either the additional module mod_adhoc_oauth2_client or manually editing the database. That method was enough to have something to test with, but would not probably not scale easily. Dynamic client registration allows creating clients on the fly, which may be even easier in theory. In order to not allow basically unauthenticated writes to the database, we implement a stateless model here. per_host_key := HMAC(config -> oauth2_registration_key, hostname) client_id := JWT { client metadata } signed with per_host_key client_secret := HMAC(per_host_key, client_id) This should ensure everything we need to know is part of the client_id, allowing redirects etc to be validated, and the client_secret can be validated with only the client_id and the per_host_key. A nonce injected into the client_id JWT should ensure nobody can submit the same client metadata and retrieve the same client_secret
author Kim Alvefur <zash@zash.se>
date Fri, 03 Mar 2023 21:14:19 +0100
parents 4b47c8eeca22
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1889
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 ---
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 summary: External Service Discovery
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 ...
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 Introduction
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 ============
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 This module adds support for [XEP-0215: External Service Discovery],
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9 which lets Prosody advertise non-XMPP services.
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 Configuration
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 =============
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 Example services from the XEP:
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 ``` {.lua}
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17 modules_enabled = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 -- other modules ...
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 "extdisco";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 }
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 external_services = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 ["stun.shakespeare.lit"] = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24 port="9998";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25 transport="udp";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 type="stun";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 };
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 ["relay.shakespeare.lit"] = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29 password="jj929jkj5sadjfj93v3n";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 port="9999";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
31 transport="udp";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
32 type="turn";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 username="nb78932lkjlskjfdb7g8";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 };
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35 ["192.0.2.1"] = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
36 port="8888";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
37 transport="udp";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
38 type="stun";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
39 };
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
40 ["192.0.2.1"] = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
41 port="8889";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
42 password="93jn3bakj9s832lrjbbz";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
43 transport="udp";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
44 type="turn";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
45 username="auu98sjl2wk3e9fjdsl7";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
46 };
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
47 ["ftp.shakespeare.lit"] = {
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
48 name="Shakespearean File Server";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
49 password="guest";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
50 port="20";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
51 transport="tcp";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
52 type="ftp";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
53 username="guest";
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
54 };
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
55 }
46c49cff1023 mod_extdisco: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
56 ```
4020
4b47c8eeca22 mod_extdisco, mod_turncredentials: Note incompatibility in readmes.
tastytea <tastytea@tastytea.de>
parents: 1889
diff changeset
57
4b47c8eeca22 mod_extdisco, mod_turncredentials: Note incompatibility in readmes.
tastytea <tastytea@tastytea.de>
parents: 1889
diff changeset
58 Compatibility
4b47c8eeca22 mod_extdisco, mod_turncredentials: Note incompatibility in readmes.
tastytea <tastytea@tastytea.de>
parents: 1889
diff changeset
59 =============
4b47c8eeca22 mod_extdisco, mod_turncredentials: Note incompatibility in readmes.
tastytea <tastytea@tastytea.de>
parents: 1889
diff changeset
60
4b47c8eeca22 mod_extdisco, mod_turncredentials: Note incompatibility in readmes.
tastytea <tastytea@tastytea.de>
parents: 1889
diff changeset
61 Incompatible with
4b47c8eeca22 mod_extdisco, mod_turncredentials: Note incompatibility in readmes.
tastytea <tastytea@tastytea.de>
parents: 1889
diff changeset
62 [mod_turncredentials](https://modules.prosody.im/mod_turncredentials).