docs: Authentication section #2234
No reviewers
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No assignees
6 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity!2234
Loading…
Reference in a new issue
No description provided.
Delete branch "stratself/continuwuity:stratself/docs-authentication"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a dedicated chapter for authentication in Continuwuity. This functionality was previously underdocumented.
The phrases "OAuth/legacy authentication" has been changed to "Oauth/legacy login flows" to separate it from authentication sources (internal versus delegated). Further pages were added to detail on these sources
Preview: https://muc.muoi.me/authentication.html
Closes #2140
Pull request checklist:
mainbranch, and the branch is named something other thanmain.myself, if applicable. This includes ensuring code compiles.
@ -0,0 +1,40 @@# RegistrationThis document could be retitled as "Internal authentication" and covers all about registration, email, and password resets
I did this
reviewing on the forge, at least on my device, seems to be bugged, so I can only drop these for now and I'll finish later.
@ -0,0 +6,4 @@Continuwuity implements the following authentication flows:- **OAuth login** (also known as **next-gen auth**): clients redirect the user to Continuwuity's login/signup page."own login and registration page"
@ -0,0 +7,4 @@Continuwuity implements the following authentication flows:- **OAuth login** (also known as **next-gen auth**): clients redirect the user to Continuwuity's login/signup page.- **Legacy login** (also known as the **UIAA** framework): clients logs in/signs up directly to the server via its own UI."clients provide their own UI to log in to or register with the server directly"
@ -0,0 +13,4 @@:::important Configure your client well-known for OAuth loginsTo ensure OAuth logins work, Continuwuity must know the path from which its Client-Server API is being served from:"the base URL its Client-Server API is being served on"
@ -0,0 +1,49 @@# Internal authenticationContinuwuity by default comes with an internal database for user authentication. Using the internal database allows for self-servicing of account registration, linking emails, and password resets."by default" implies the internal database stops existing in other modes of operation, which is not true. You may wish to drop it and suffix the first sentence with ", which it uses by default."
@ -0,0 +18,4 @@Registrations can be made via Continuwuity's account management page, as well as in-band from within a Matrix client (if legacy login is enabled).Admin-issued tokens are the recommended method of registration. These tokens can be scoped with an expiry duration or maximum times used, and are suited for private/invite-only homeservers. See the `!admin token` commands for more details."Admin-issued tokens are the recommended registration method. These tokens are well suited for private or invite-only servers, and they can be scoped with an expiry duration or given a usage limit."
It would also be worth linking to the admin commands reference.
Linking in a future commit
you never implemented the other feedback, so this has not been resolved
@ -0,0 +16,4 @@| 6 | Static token + email + reCAPTCHA | Methods 3 + 5 || 7 | Email only | `require_email_for_registration = true` in `[global.smtp]` section. See [Email configuration](#email-configuration) |Registrations can be made via Continuwuity's account management page, as well as in-band from within a Matrix client (if legacy login is enabled)."Users can register on Continuwiity's account management page, or directly within a Matrix client if legacy login is enabled."
eda47afa707e0f78e7d37e0f78e7d3769fa2b156769fa2b156604c0c2c21WIP: docs: Authentication sectionto docs: Authentication sectionReady for next round of review. Removed
/guides/oidc.mdxin place of/authentication/oidc.mdx, and website updated to reflect this as well.@ -0,0 +6,4 @@Continuwuity implements the following authentication flows:- **OAuth login** (also known as **next-gen auth**): clients redirect the user to Continuwuity's own login and registration page to complete the authentication process.To match other docs like https://areweoidcyet.com/
Nevermind, the MSC is lowercase: https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/3861-next-generation-auth.md#:~:text=next%2Dgeneration%20auth,-%27%2E
@ -0,0 +4,4 @@## RegistrationRegistration is disabled by default. To enable it, set `allow_registration = true` in your config file and configure at least one of the registration methods below.s/configure/use, as e.g. method 1 doesn't need configuration.@ -0,0 +17,4 @@| 7 | Static token + email | Method 2 + `require_email_for_token_registration = true` in `[global.smtp]`. See [Email configuration](#email-configuration) || 8 | Static token + email + reCAPTCHA | Methods 3 + 7 |Users can register on Continuwiity's account management page, or directly within a Matrix client if legacy login is enabled.s/Continuwiity/Continuwuity@ -0,0 +14,4 @@### Configuring the OIDC providerThis guide will use [**kanidm**][kanidm] as an example, but the described steps are broadly applicable to other identity providers. Contributions for them are welcome.s/kanidm/Kanidmto match https://kanidm.com/@ -0,0 +74,4 @@### Minting tokens for non-OIDC accountsWith OIDC delegation enabled, accounts without an OIDC mapping can still be created (via `!admin users create`), but will not be able to log in to the homeserver. To accommodate this, homeserver admins can use the [`!admin users issue-token`](../reference/admin/users#admin-users-issue-token) command to issue tokens for them. This command requires the account to have set a local password, which can be done with [`!admin users reset-password`](../reference/admin/users#admin-users-reset-password).Would be good to mention why a user might want to do this, e.g. mentioning its useful for bots, etc.
@ -0,0 +78,4 @@### Decommissioning OIDC delegationIt is possible to revert to using the internal database for authentication. First, uncomment the `[global.oauth.oidc]` section in your config file and restart the homeserver. Then, execute the [`!admin users reset-password --convert-to-local-account`](../reference/admin/users#admin-users-reset-password) for each user, to assign them a local password and convert their linked accounts into local ones.Wait, uncomment? Why would uncommenting that section turn off OIDC?
ba81e8809f7b1176fbe9LGTM
@ -0,0 +9,4 @@- **OAuth login** (also known as **next-gen auth**): clients redirect the user to Continuwuity's own login and registration page to complete the authentication process.- **Legacy login** (also known as the **UIAA** framework): clients provide their own UI to log in to or register with the server directly.Different sets of clients support different flows, but most clients are moving towards next-gen auth. One can set which login mode(s) are allowed via the `compatibility_mode` variable of the `[global.oauth]` config file section."mode(s)" -> "modes"
plurals are encompassing here
@ -0,0 +25,4 @@## Email configurationContinuwuity can be configured to send emails via an SMTP relay of your choice. These are used for verifying user email addresses and sending password resets links to them."password resets" -> "password reset"
@ -0,0 +6,4 @@When delegated authentication is configured, Continuwuity will disable its support for legacy logins. **Only clients that support OAuth** will be able to login.:::An account on the homeserver can be linked with only **one** OIDC subject claim (i.e. one account on the OIDC side) at a time. Linking an account will also disable its ability to do self-deactivation."can only be associated with one OIDC subject claim - that is, one account on the identity provider - at a time. Linking an account will prevent deactivating it from within Continuwuity."
also, consider using "Subject Identifier claim" like you do everywhere else
@ -0,0 +48,4 @@### Configuring ContinuwuityConfigure Continuwuity with the client ID, client secret, and discovery URL provided from the steps above. kanidm has a different discovery URL for each client, but other identity providers may have a single discovery URL at the root of their domain.drop "provided", and "Kanidm" should be capitalised everywhere
kanidm is stylized in lowercase, no?
it is not: https://kanidm.com
@ -0,0 +78,4 @@### Manually linking users to OIDC claimsTo view associations between local users and their linked Subject Identifier claim (i.e. the unique ID of the account on the OIDC provider's side), issue the following command:You already clarified what a subject claim is earlier in the document. Pick one style of explanation and stick to it broadly.
Fixed in a7b44b9934
@ -0,0 +86,4 @@("ba543628-e6a5-45d8-9bd2-6cc497400136", "jane")```These associations can be changed manually with the [`!admin oidc`](../reference/admin/oidc) commands, which is useful to debug some account linkage issues. For example, to link the user `jane` to a new Subject Identifier claim of `721c36a8-ce04-4474-8e97-b62655b07340`:"which are useful"
@ -0,0 +98,4 @@### Decommissioning OIDC delegationIt is possible to revert to using the internal database for authentication. First, comment out the `[global.oauth.oidc]` section in your config file and restart the homeserver. Then, execute the [`!admin users reset-password --convert-to-local-account`](../reference/admin/users#admin-users-reset-password) for each user, to assign them a local password and convert their linked accounts into local ones.remove the final comma in this excerpt
@ -0,0 +12,4 @@| 2 | Static registration token | `registration_token` or `registration_token_file` || 3 | reCAPTCHA-only registration | `recaptcha_site_key` and `recaptcha_private_site_key` || 4 | Email-only registration | `require_email_for_registration = true` in `[global.smtp]` section. See [Email configuration](#email-configuration) || 5 | Static token + reCAPTCHA | Methods 2 + 3 |This is not a possible setup. You'll end up with reCAPTCHA-only registration and, independently, token registration.
Fixed in
9dfdbf183e@ -0,0 +17,4 @@| 7 | Static token + email | Method 2 + `require_email_for_token_registration = true` in `[global.smtp]`. See [Email configuration](#email-configuration) || 8 | Static token + email + reCAPTCHA | Methods 3 + 7 |Users can register on Continuwuity's account management page, or directly within a Matrix client if legacy login is enabled.Users can register through OAuth-compatible Matrix clients.
The client will redirect to the account mgmt page anyways. Thinking of better wording.
If they started registration through a client, they'll be redirected to the OAuth grant page after registering.
I will remove this line as it is already mentioned in
authentication.mdx@ -0,0 +76,4 @@With OIDC delegation enabled, accounts without an OIDC mapping (such as bot accounts) can still be created via the admin commands, but will not be able to log in to the homeserver. To accommodate this, homeserver admins can use the [`!admin users issue-token`](../reference/admin/users#admin-users-issue-token) command to issue tokens for them. This command requires the account to have set a local password, which can be done with [`!admin users reset-password`](../reference/admin/users#admin-users-reset-password).### Manually linking users to OIDC claimsThis is only really useful for debugging. I'm ambivalent about having it in the docs.
A couple nits on phrasing (lgtm otherwise, independent of other review comments)
@ -0,0 +1,35 @@# AuthenticationThis chapter describes various ways to authenticate to Continuwuity.nit: s/to continuwuity/with continuwuity/
"with" implies Continuwuity is a key, rather than a lock, to put it simply. "to" is correct. one would authenticate to Continuwuity with their credentials within their client, for example.
@ -0,0 +7,4 @@Continuwuity implements the following authentication flows:- **OAuth login** (also known as **next-gen auth**): clients redirect the user to Continuwuity's own login and registration page to complete the authentication process.- **Legacy login** (also known as the **UIAA** framework): clients provide their own UI to log in to or register with the server directly."UIAA" is a technical detail that most users won't need to know even exists, I'm not sure calling it out by name as anything other than legacy auth is useful
Some clients reveal errors such as "User Interactive Authentication is not supported". I think I'll
s/UIAA/the full acronym for UIA@ -0,0 +28,4 @@Continuwuity can read user authentication data from the following sources:- **Internal database** - this is the default setup for Continuwuity. It allows for registration, email, and password reset self-service. See the [**internal authentication documentation**](./authentication/internal).nit: I think "Internal authentication" or "Local authentication" might be friendlier, especially with the "Delegated authentication" counterpart
Will do it as
7b1176fbe9bb16bb5495bb16bb5495b408d8ba9db408d8ba9da9cabd7812a9cabd78120df9d040f40df9d040f43722537843372253784355f855c2c5