You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/setup/sso.md
+67-3Lines changed: 67 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ The authentication service supports importing the following user attributes from
40
40
- The localpart/username (e.g. `@localpart:example.com`)
41
41
- The display name
42
42
- An email address
43
+
- An account name, to help end users identify what account they are using
43
44
44
45
For each of those attributes, administrators can configure a mapping using the claims provided by the upstream provider.
45
46
They can also configure what should be done for each of those attributes. It can either:
@@ -49,12 +50,20 @@ They can also configure what should be done for each of those attributes. It can
49
50
-`force`: automatically import the attribute, but don't fail if it is not provided by the provider
50
51
-`require`: automatically import the attribute, and fail if it is not provided by the provider
51
52
52
-
A Jinja2 template is used as mapping for each attribute. The template currently has one `user` variable, which is an object with the claims got through the `id_token` given by the provider.
53
+
A Jinja2 template is used as mapping for each attribute.
53
54
The following default templates are used:
54
55
55
56
-`localpart`: `{{ user.preferred_username }}`
56
57
-`displayname`: `{{ user.name }}`
57
58
-`email`: `{{ user.email }}`
59
+
-`account_name`: none
60
+
61
+
The template has the following variables available:
62
+
63
+
-`id_token_claims`: an object with the claims got through the `id_token` given by the provider, if provided by the provider
64
+
-`userinfo_claims`: an object with the claims got through the `userinfo` endpoint, if `fetch_userinfo` is enabled
65
+
-`user`: an object which contains the claims from both the `id_token` and the `userinfo` endpoint
66
+
-`extra_callback_parameters`: an object with the additional parameters the provider sent to the redirect URL
58
67
59
68
## Multiple providers behaviour
60
69
@@ -95,10 +104,14 @@ upstream_oauth2:
95
104
# SiWA passes down the user infos as query parameters in the callback
96
105
# which is available in the extra_callback_parameters variable
97
106
template: |
98
-
{%- set user = extra_callback_parameters["user"] | from_json -%}
0 commit comments