Files
authentik/blueprints/system/providers-google-workspace.yaml
Jens L 7bb90b1661 providers/microsoft_entra: fix error when updating connection attributes (#10039)
* providers/microsoft_entra: fix error when updating connection attributes

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* include URL to field references

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* only set gws user password when creating by default

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* merge instead of replace connection attributes

an update might not return all attributes so we don't want to fully replace the attributes

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
2024-06-11 16:03:23 +09:00

47 lines
1.8 KiB
YAML

version: 1
metadata:
labels:
blueprints.goauthentik.io/system: "true"
name: System - Google Workspace Provider - Mappings
entries:
- identifiers:
managed: goauthentik.io/providers/google_workspace/user
model: authentik_providers_google_workspace.googleworkspaceprovidermapping
attrs:
name: "authentik default Google Workspace Mapping: User"
expression: |
# Field reference:
# https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User
# Google require givenName and familyName to be set
givenName, familyName = request.user.name, " "
formatted = request.user.name + " "
# This default sets givenName to the name before the first space
# and the remainder as family name
# if the user's name has no space the givenName is the entire name
if " " in request.user.name:
givenName, _, familyName = request.user.name.partition(" ")
formatted = request.user.name
user = {
"name": {
"fullName": formatted,
"familyName": familyName.strip(),
"givenName": givenName.strip(),
"displayName": formatted,
},
"suspended": not request.user.is_active,
}
if not connection:
user["password"] = request.user.password
return user
- identifiers:
managed: goauthentik.io/providers/google_workspace/group
model: authentik_providers_google_workspace.googleworkspaceprovidermapping
attrs:
name: "authentik default Google Workspace Mapping: Group"
expression: |
# Field reference:
# https://developers.google.com/admin-sdk/directory/reference/rest/v1/groups#Group
return {
"name": group.name,
}