20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
# File 'manifests/freeipa_ldap_mappers.pp', line 20
define keycloak::freeipa_ldap_mappers (
String $realm,
String $groups_dn,
String $roles_dn,
String $parent_id = $title,
) {
$title_suffix = "for ${title}"
$defaults = {
ensure => 'present',
realm => $realm,
ldap => $parent_id,
always_read_value_from_ldap => true,
read_only => true,
}
keycloak_ldap_mapper { "cn ${title_suffix}":
* => $defaults,
ldap_attribute => 'cn',
user_model_attribute => 'cn',
is_mandatory_in_ldap => true,
}
keycloak_ldap_mapper { "displayName ${title_suffix}":
* => $defaults,
ldap_attribute => 'displayName',
user_model_attribute => 'displayName',
is_mandatory_in_ldap => true,
}
keycloak_ldap_mapper { "email ${title_suffix}":
* => $defaults,
ldap_attribute => 'mail',
user_model_attribute => 'email',
is_mandatory_in_ldap => true,
}
keycloak_ldap_mapper { "first name ${title_suffix}":
* => $defaults,
ldap_attribute => 'givenName',
user_model_attribute => 'firstName',
is_mandatory_in_ldap => true,
}
keycloak_ldap_mapper { "last name ${title_suffix}":
* => $defaults,
ldap_attribute => 'sn',
user_model_attribute => 'lastName',
is_mandatory_in_ldap => true,
}
keycloak_ldap_mapper { "username ${title_suffix}":
* => $defaults,
ldap_attribute => 'uid',
user_model_attribute => 'username',
is_mandatory_in_ldap => true,
}
keycloak_ldap_mapper { "modify date ${title_suffix}":
* => $defaults,
ldap_attribute => 'modifyTimestamp',
user_model_attribute => 'modifyTimestamp',
is_mandatory_in_ldap => false,
}
keycloak_ldap_mapper { "creation date ${title_suffix}":
* => $defaults,
ldap_attribute => 'createTimestamp',
user_model_attribute => 'createTimestamp',
is_mandatory_in_ldap => false,
}
keycloak_ldap_mapper { "roles ${title_suffix}":
ensure => 'present',
realm => $realm,
type => 'role-ldap-mapper',
ldap => $parent_id,
is_mandatory_in_ldap => false,
mode => 'READ_ONLY',
memberof_ldap_attribute => 'memberOf',
membership_attribute_type => 'UID',
membership_ldap_attribute => 'memberUid',
membership_user_ldap_attribute => 'uid',
role_name_ldap_attribute => 'cn',
role_object_classes => 'posixGroup',
roles_dn => $roles_dn,
use_realm_roles_mapping => true,
user_roles_retrieve_strategy => 'LOAD_ROLES_BY_MEMBER_ATTRIBUTE',
}
keycloak_ldap_mapper { "groups ${title_suffix}":
ensure => 'present',
realm => $realm,
type => 'group-ldap-mapper',
ldap => $parent_id,
is_mandatory_in_ldap => false,
mode => 'READ_ONLY',
memberof_ldap_attribute => 'memberOf',
drop_non_existing_groups_during_sync => true,
group_name_ldap_attribute => 'cn',
group_object_classes => 'groupOfNames, posixGroup',
groups_dn => $groups_dn,
ignore_missing_groups => false,
membership_attribute_type => 'DN',
membership_ldap_attribute => 'member',
membership_user_ldap_attribute => 'uid',
preserve_group_inheritance => false,
user_roles_retrieve_strategy => 'LOAD_GROUPS_BY_MEMBER_ATTRIBUTE',
}
}
|