Add support for OAuth 2.0 authentication

This commit is contained in:
Simon Ser
2022-09-12 11:38:43 +02:00
parent bbc94c88c0
commit e815295503
5 changed files with 228 additions and 4 deletions

View File

@@ -103,8 +103,9 @@ gamja default settings can be set using a `config.json` file at the root:
"autojoin": "#gamja",
// Controls how the password UI is presented to the user. Set to
// "mandatory" to require a password, "optional" to accept one but not
// require it, "disabled" to never ask for a password, or "external" to
// use SASL EXTERNAL. Defaults to "optional".
// require it, "disabled" to never ask for a password, "external" to
// use SASL EXTERNAL, "oauth2" to use SASL OAUTHBEARER. Defaults to
// "optional".
"auth": "optional",
// Default nickname (string). If it contains a "*" character, it will
// be replaced with a random string.
@@ -116,6 +117,19 @@ gamja default settings can be set using a `config.json` file at the root:
// disable. Enabling PINGs can have an impact on client power usage and
// should only be enabled if necessary.
"ping": 60
},
// OAuth 2.0 settings.
"oauth2": {
// OAuth 2.0 server URL (string). The server must support OAuth 2.0
// Authorization Server Metadata (RFC 8414) or OpenID Connect
// Discovery.
"url": "https://auth.example.org",
// OAuth 2.0 client ID (string).
"client_id": "asdf",
// OAuth 2.0 client secret (string).
"client_secret": "ghjk",
// OAuth 2.0 scope (string).
"scope": "profile"
}
}
```