From 7b1350942dad987003ed7bc76c12e5dc3f1040b8 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Fri, 19 Apr 2019 11:45:24 +0200 Subject: [PATCH] Custom attribute mapping for Django user model --- .../tests/attribute-maps/django_saml_uri.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 djangosaml2/tests/attribute-maps/django_saml_uri.py diff --git a/djangosaml2/tests/attribute-maps/django_saml_uri.py b/djangosaml2/tests/attribute-maps/django_saml_uri.py new file mode 100644 index 00000000..054ddb0d --- /dev/null +++ b/djangosaml2/tests/attribute-maps/django_saml_uri.py @@ -0,0 +1,19 @@ +X500ATTR_OID = 'urn:oid:2.5.4.' +PKCS_9 = 'urn:oid:1.2.840.113549.1.9.1.' +UCL_DIR_PILOT = 'urn:oid:0.9.2342.19200300.100.1.' + + MAP = { + 'identifier': 'urn:oasis:names:tc:SAML:2.0:attrname-format:uri', + 'fro': { + X500ATTR_OID+'3': 'first_name', # cn + X500ATTR_OID+'4': 'last_name', # sn + PKCS_9+'1': 'email', + UCL_DIR_PILOT+'1': 'uid', + }, + 'to': { + 'first_name': X500ATTR_OID+'3', + 'last_name': X500ATTR_OID+'4', + 'email' : PKCS_9+'1', + 'uid': UCL_DIR_PILOT+'1', + } +}