Skip to content

Commit 5ecf9d6

Browse files
committed
Merge branch 'feature-update-ldap-attribute-store'
2 parents 817f803 + 12b96c4 commit 5ecf9d6

File tree

3 files changed

+439
-204
lines changed

3 files changed

+439
-204
lines changed
Lines changed: 55 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,65 @@
1-
module: plugins.microservices.ldap_attribute_store.LdapAttributeStore
1+
module: LdapAttributeStore
22
name: LdapAttributeStore
33
config:
4-
ldap_url: ldaps://ldap.example.org
5-
bind_dn: cn=admin,dc=example,dc=org
6-
bind_password: xxxxxxxx
7-
search_base: ou=People,dc=example,dc=org
8-
search_return_attributes:
9-
# format is LDAP attribute name : internal attribute name
10-
sn: surname
11-
givenName: givenname
12-
mail: mail
13-
employeeNumber: employeenumber
14-
isMemberOf: ismemberof
15-
idp_identifiers:
16-
# Ordered list of identifiers asserted as attributes by
17-
# IdP to use when constructing search filter to find
18-
# user record in LDAP directory. This example searches
19-
# in order for eduPersonUniqueId, eduPersonPrincipalName
20-
# combined with SAML persistent, eduPersonPrincipalName
21-
# combined with eduPersonTargetedId,
22-
# eduPersonPrincipalName, SAML persistent, and
23-
# eduPersonTargetedId.
24-
- epuid
25-
-
26-
- eppn
27-
- name_id: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
28-
-
29-
- eppn
30-
- edupersontargetedid
31-
- eppn
32-
- name_id: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
33-
- edupersontargetedid
34-
ldap_identifier_attribute: uid
35-
# Whether to clear values for attributes incoming
36-
# to this microservice. Default is no or false.
37-
clear_input_attributes: no
38-
# List of LDAP attributes to use as input to hashing to create
39-
# NameID.
40-
user_id_from_attrs:
41-
- employeeNumber
4+
"":
5+
ldap_url: ldaps://ldap.example.org
6+
bind_dn: cn=admin,dc=example,dc=org
7+
bind_password: xxxxxxxx
8+
search_base: ou=People,dc=example,dc=org
9+
search_return_attributes:
10+
# Format is LDAP attribute name : internal attribute name
11+
sn: surname
12+
givenName: givenname
13+
mail: mail
14+
employeeNumber: employeenumber
15+
isMemberOf: ismemberof
16+
# LDAP connection pool size
17+
pool_size: 10
18+
# LDAP connection pool seconds to wait between calls out to server
19+
# to keep the connection alive (uses harmless Abandon(0) call)
20+
pool_keepalive: 10
21+
ordered_identifier_candidates:
22+
# Ordered list of identifiers to use when constructing the
23+
# search filter to find the user record in LDAP directory.
24+
# This example searches in order for eduPersonUniqueId, eduPersonPrincipalName
25+
# combined with SAML persistent NameID, eduPersonPrincipalName
26+
# combined with eduPersonTargetedId, eduPersonPrincipalName,
27+
# SAML persistent NameID, and eduPersonTargetedId.
28+
- attribute_names: [epuid]
29+
- attribute_names: [eppn, name_id]
30+
name_id_format: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
31+
- attribute_names: [eppn, edupersontargetedid]
32+
- attribute_names: [eppn]
33+
- attribute_names: [name_id]
34+
name_id_format: urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
35+
add_scope: issuer_entityid
36+
- attribute_names: [edupersontargetedid]
37+
add_scope: issuer_entityid
38+
ldap_identifier_attribute: uid
39+
# Whether to clear values for attributes incoming
40+
# to this microservice. Default is no or false.
41+
clear_input_attributes: no
42+
# List of LDAP attributes to use as input to hashing to create
43+
# NameID.
44+
user_id_from_attrs:
45+
- employeeNumber
46+
# Where to redirect the browser if no record is returned
47+
# from LDAP. The default is not to redirect.
48+
on_ldap_search_result_empty: https://my.vo.org/please/go/enroll
4249
# Configuration may also be done per-SP with any
4350
# missing parameters taken from the default if any.
4451
# The configuration key is the entityID of the SP.
4552
#
4653
# For example:
47-
https://sp.myserver.edu/shibboleth-sp
54+
https://sp.myserver.edu/shibboleth-sp:
4855
search_base: ou=People,o=MyVO,dc=example,dc=org
49-
eduPersonPrincipalName: employeenumber
56+
search_return_attributes:
57+
employeeNumber: employeenumber
58+
ordered_identifier_candidates:
59+
- attribute_names: [eppn]
5060
user_id_from_attrs:
5161
- uid
62+
# The microservice may be configured to ignore a particular SP.
63+
https://another.sp.myserver.edu:
64+
ignore: true
65+

src/satosa/frontends/saml2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,13 @@ def _handle_authn_request(self, context, binding_in, idp):
210210

211211
subject = authn_req.subject
212212
subject_id = subject.name_id.text if subject else None
213-
# XXX TODO how should type be handled in relation to name_format above?
214-
# subject_type = subject.name_id.format if subject else None
213+
# XXX should subject.name_id.format overwrite name_id_policy.format?
214+
subject_type = subject.name_id.format if subject else name_format
215215

216216
requester_name = self._get_sp_display_name(idp, requester)
217217
internal_req = InternalData(
218218
subject_id=subject_id,
219-
subject_type=name_format,
219+
subject_type=subject_type,
220220
requester=requester,
221221
requester_name=requester_name,
222222
)

0 commit comments

Comments
 (0)