Skip to content

Commit b670a2b

Browse files
authored
Merge pull request #149 from peppelinux/django_saml_uri
Custom attribute mapping for Django user model with attr format URI
2 parents 6525c99 + 7b13509 commit b670a2b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
X500ATTR_OID = 'urn:oid:2.5.4.'
2+
PKCS_9 = 'urn:oid:1.2.840.113549.1.9.1.'
3+
UCL_DIR_PILOT = 'urn:oid:0.9.2342.19200300.100.1.'
4+
5+
MAP = {
6+
'identifier': 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri',
7+
'fro': {
8+
X500ATTR_OID+'3': 'first_name', # cn
9+
X500ATTR_OID+'4': 'last_name', # sn
10+
PKCS_9+'1': 'email',
11+
UCL_DIR_PILOT+'1': 'uid',
12+
},
13+
'to': {
14+
'first_name': X500ATTR_OID+'3',
15+
'last_name': X500ATTR_OID+'4',
16+
'email' : PKCS_9+'1',
17+
'uid': UCL_DIR_PILOT+'1',
18+
}
19+
}

0 commit comments

Comments
 (0)