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

Commit

Permalink
Update Mastodon SSO instructions (#15587)
Browse files Browse the repository at this point in the history
  • Loading branch information
villepeh authored May 15, 2023
1 parent 3690d5b commit aa5c059
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/15587.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update and improve Mastodon Single Sign-On documentation.
6 changes: 4 additions & 2 deletions docs/openid.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ You should receive a response similar to the following. Make sure to save it.
{"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"}
```

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:
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:

```yaml
oidc_providers:
Expand All @@ -585,7 +585,9 @@ oidc_providers:
scopes: ["read"]
user_mapping_provider:
config:
subject_claim: "id"
subject_template: "{{ user.id }}"
localpart_template: "{{ user.username }}"
display_name_template: "{{ user.display_name }}"
```

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

0 comments on commit aa5c059

Please sign in to comment.