website/integrations: fix google username mapping

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-01-30 18:31:08 +01:00
parent 27231fd5d7
commit a9ee43791d
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -94,9 +94,9 @@ email = request.context["prompt_data"]["email"]
request.context["prompt_data"]["username"] = email request.context["prompt_data"]["username"] = email
# Set username to email without domain # Set username to email without domain
# request.context["prompt_data"]["username"] = email.split("@")[0] # request.context["prompt_data"]["username"] = email.split("@")[0]
return True return False
``` ```
Afterwards, edit the source's enrollment flow (by default _default-source-enrollment_), expand the policies bound to the first stage (_default-source-enrollment-prompt_), and bind the policy created above. Afterwards, any new logins will automatically have their google email address used as their username. Afterwards, edit the source's enrollment flow (by default _default-source-enrollment_), expand the policies bound to the first stage (_default-source-enrollment-prompt_), and bind the policy created above. Make sure the newly created policy comes before _default-source-enrollment-if-username_. Afterwards, any new logins will automatically have their google email address used as their username.
This can be combined with disallowing users from changing their usernames, see [Configuration](../../../docs/installation/configuration#authentik_default_user_change_username). This can be combined with disallowing users from changing their usernames, see [Configuration](../../../docs/installation/configuration#authentik_default_user_change_username).