Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit aa5c059

Browse files
authored
Update Mastodon SSO instructions (#15587)
1 parent 3690d5b commit aa5c059

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

changelog.d/15587.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update and improve Mastodon Single Sign-On documentation.

docs/openid.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ You should receive a response similar to the following. Make sure to save it.
569569
{"client_id":"someclientid_123","client_secret":"someclientsecret_123","id":"12345","name":"my_synapse_app","redirect_uri":"https://[synapse_public_baseurl]/_synapse/client/oidc/callback","website":null,"vapid_key":"somerandomvapidkey_123"}
570570
```
571571

572-
As the Synapse login mechanism needs an attribute to uniquely identify users, and Mastodon's endpoint does not return a `sub` property, an alternative `subject_claim` has to be set. Your Synapse configuration should include the following:
572+
As the Synapse login mechanism needs an attribute to uniquely identify users, and Mastodon's endpoint does not return a `sub` property, an alternative `subject_template` has to be set. Your Synapse configuration should include the following:
573573

574574
```yaml
575575
oidc_providers:
@@ -585,7 +585,9 @@ oidc_providers:
585585
scopes: ["read"]
586586
user_mapping_provider:
587587
config:
588-
subject_claim: "id"
588+
subject_template: "{{ user.id }}"
589+
localpart_template: "{{ user.username }}"
590+
display_name_template: "{{ user.display_name }}"
589591
```
590592

591593
Note that the fields `client_id` and `client_secret` are taken from the CURL response above.

0 commit comments

Comments
 (0)