Skip to content

Commit 5a2428a

Browse files
committed
add doc for "Allow linking existing user accounts" with security notice
1 parent e9436d7 commit 5a2428a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/setup/sso.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ The template has the following variables available:
6565
- `user`: an object which contains the claims from both the `id_token` and the `userinfo` endpoint
6666
- `extra_callback_parameters`: an object with the additional parameters the provider sent to the redirect URL
6767

68+
69+
## Allow linking existing user accounts
70+
71+
The authentication service supports linking external provider identities to existing local user accounts.
72+
73+
To enable this behavior, the following option must be explicitly set in the provider configuration:
74+
75+
* `allow_existing_users: true` *(default: false)* : when a user authenticates with the provider for the first time, the system checks whether a local user already exists with a `localpart` matching the attribute mapping `localpart` , _by default `{{ user.preferred_username }}`_. If a match is found, the external identity is linked to the existing local account.
76+
77+
To enable this option, the `localpart` mapping must be set to either `force` or `require`.
78+
79+
> ⚠️ **Security Notice**
80+
> Enabling this option can introduce a risk of account takeover.
81+
>
82+
> To mitigate this risk, ensure that this option is only enabled for identity providers where you can guarantee that the attribute mapping `localpart` will reliably and uniquely correspond to the intended local user account.
83+
84+
6885
## Multiple providers behaviour
6986

7087
Multiple authentication methods can be configured at the same time, in which case the authentication service will let the user choose which one to use.

0 commit comments

Comments
 (0)