Skip to content

Commit

Permalink
website/integrations: mastodon: set correct uid field (#11945)
Browse files Browse the repository at this point in the history
* website/integrations: mastodon: set correct uid field

Setting the `OIDC_UID_FIELD` as `sub` created users on Mastodon with random usernames. Once this was changed to `preferred_username`, new users were created with their usernames set in authentik. My assumption is that users would wish to have the same username rather than have a random one generated.

Signed-off-by: 4d62 <github-user@sdko.org>

* website/integrations: mastodon: apply review suggestions

A: #11945 (review)
B: #11945 (comment)

Signed-off-by: 4d62 <github-user@sdko.org>

---------

Signed-off-by: 4d62 <github-user@sdko.org>
  • Loading branch information
4d62 authored Dec 3, 2024
1 parent e077a5c commit 4aeb7c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion website/integrations/services/mastodon/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ Create an application (under _Resources/Applications_) with these settings:

Configure Mastodon `OIDC_` settings by editing the `.env.production` and add the following:

:::warning
When using `preferred_username` as the user identifier, ensure that the [Allow users to change username setting](https://docs.goauthentik.io/docs/sys-mgmt/settings#allow-users-to-change-username) is disabled to prevent authentication issues.
:::

:::info
You can configure Mastodon to use either the `sub` or `preferred_username` as the UID field under `OIDC_UID_FIELD`. The `sub` option uses a unique, stable identifier for the user, while `preferred_username` uses the username configured in authentik.
:::

```
OIDC_ENABLED=true
OIDC_DISPLAY_NAME=authentik
OIDC_DISCOVERY=true
OIDC_ISSUER=< OpenID Configuration Issuer>
OIDC_AUTH_ENDPOINT=https://authentik.company/application/o/authorize/
OIDC_SCOPE=openid,profile,email
OIDC_UID_FIELD=sub
OIDC_UID_FIELD=preferred_username
OIDC_CLIENT_ID=<Client ID>
OIDC_CLIENT_SECRET=<Client Secret>
OIDC_REDIRECT_URI=https://mastodon.company/auth/auth/openid_connect/callback
Expand Down

0 comments on commit 4aeb7c8

Please sign in to comment.