Skip to content

Commit 817733a

Browse files
author
Roland Hedberg
committed
Added tool to keep attributemaps in sync. Ran it on the standard maps.
1 parent 4fcb94b commit 817733a

File tree

6 files changed

+805
-665
lines changed

6 files changed

+805
-665
lines changed

src/saml2/attributemaps/adfs_v1x.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
# See http://technet.microsoft.com/en-us/library/cc733065(v=ws.10).aspx
2-
# and http://technet.microsoft.com/en-us/library/ee913589(v=ws.10).aspx
3-
# for information regarding the default claim types supported by
4-
# Microsoft ADFS v1.x.
1+
CLAIMS = 'http://schemas.xmlsoap.org/claims/'
2+
53

64
MAP = {
75
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
8-
"fro": {
9-
'http://schemas.xmlsoap.org/claims/commonname': 'commonName',
10-
'http://schemas.xmlsoap.org/claims/emailaddress': 'emailAddress',
11-
'http://schemas.xmlsoap.org/claims/group': 'group',
12-
'http://schemas.xmlsoap.org/claims/upn': 'upn',
13-
},
14-
"to": {
15-
'commonName': 'http://schemas.xmlsoap.org/claims/commonname',
16-
'emailAddress': 'http://schemas.xmlsoap.org/claims/emailaddress',
17-
'group': 'http://schemas.xmlsoap.org/claims/group',
18-
'upn': 'http://schemas.xmlsoap.org/claims/upn',
6+
'fro': {
7+
CLAIMS+'commonname': 'commonName',
8+
CLAIMS+'emailaddress': 'emailAddress',
9+
CLAIMS+'group': 'group',
10+
CLAIMS+'upn': 'upn',
11+
},
12+
'to': {
13+
'commonName': CLAIMS+'commonname',
14+
'emailAddress': CLAIMS+'emailaddress',
15+
'group': CLAIMS+'group',
16+
'upn': CLAIMS+'upn',
1917
}
2018
}

src/saml2/attributemaps/adfs_v20.py

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
1-
# See http://technet.microsoft.com/en-us/library/ee913589(v=ws.10).aspx
2-
# for information regarding the default claim types supported by
3-
# Microsoft ADFS v2.0.
1+
CLAIMS = 'http://schemas.xmlsoap.org/claims/'
2+
COM_WS_CLAIMS = 'http://schemas.xmlsoap.com/ws/2005/05/identity/claims/'
3+
MS_CLAIMS = 'http://schemas.microsoft.com/ws/2008/06/identity/claims/'
4+
ORG_WS_CLAIMS = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/'
5+
46

57
MAP = {
68
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified",
7-
"fro": {
8-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress': 'emailAddress',
9-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname': 'givenName',
10-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name': 'name',
11-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn': 'upn',
12-
'http://schemas.xmlsoap.org/claims/commonname': 'commonName',
13-
'http://schemas.xmlsoap.org/claims/group': 'group',
14-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/role': 'role',
15-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname': 'surname',
16-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier': 'privatePersonalId',
17-
'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier': 'nameId',
18-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod': 'authenticationMethod',
19-
'http://schemas.xmlsoap.com/ws/2005/05/identity/claims/denyonlysid': 'denyOnlySid',
20-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid': 'denyOnlyPrimarySid',
21-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid': 'denyOnlyPrimaryGroupSid',
22-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid': 'groupSid',
23-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid': 'primaryGroupSid',
24-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid': 'primarySid',
25-
'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname': 'windowsAccountName',
26-
},
27-
"to": {
28-
'emailAddress': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress',
29-
'givenName': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname',
30-
'name': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name',
31-
'upn': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn',
32-
'commonName': 'http://schemas.xmlsoap.org/claims/commonname',
33-
'group': 'http://schemas.xmlsoap.org/claims/group',
34-
'role': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/role',
35-
'surname': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname',
36-
'privatePersonalId': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier',
37-
'nameId': 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier',
38-
'authenticationMethod': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod',
39-
'denyOnlySid': 'http://schemas.xmlsoap.com/ws/2005/05/identity/claims/denyonlysid',
40-
'denyOnlyPrimarySid': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid',
41-
'denyOnlyPrimaryGroupSid': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid',
42-
'groupSid': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid',
43-
'primaryGroupSid': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid',
44-
'primarySid': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid',
45-
'windowsAccountName': 'http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname',
9+
'fro': {
10+
CLAIMS+'commonname': 'commonName',
11+
CLAIMS+'group': 'group',
12+
COM_WS_CLAIMS+'denyonlysid': 'denyOnlySid',
13+
MS_CLAIMS+'authenticationmethod': 'authenticationMethod',
14+
MS_CLAIMS+'denyonlyprimarygroupsid': 'denyOnlyPrimaryGroupSid',
15+
MS_CLAIMS+'denyonlyprimarysid': 'denyOnlyPrimarySid',
16+
MS_CLAIMS+'groupsid': 'groupSid',
17+
MS_CLAIMS+'primarygroupsid': 'primaryGroupSid',
18+
MS_CLAIMS+'primarysid': 'primarySid',
19+
MS_CLAIMS+'role': 'role',
20+
MS_CLAIMS+'windowsaccountname': 'windowsAccountName',
21+
ORG_WS_CLAIMS+'emailaddress': 'emailAddress',
22+
ORG_WS_CLAIMS+'givenname': 'givenName',
23+
ORG_WS_CLAIMS+'name': 'name',
24+
ORG_WS_CLAIMS+'nameidentifier': 'nameId',
25+
ORG_WS_CLAIMS+'privatepersonalidentifier': 'privatePersonalId',
26+
ORG_WS_CLAIMS+'surname': 'surname',
27+
ORG_WS_CLAIMS+'upn': 'upn',
28+
},
29+
'to': {
30+
'authenticationMethod': MS_CLAIMS+'authenticationmethod',
31+
'commonName': CLAIMS+'commonname',
32+
'denyOnlyPrimaryGroupSid': MS_CLAIMS+'denyonlyprimarygroupsid',
33+
'denyOnlyPrimarySid': MS_CLAIMS+'denyonlyprimarysid',
34+
'denyOnlySid': COM_WS_CLAIMS+'denyonlysid',
35+
'emailAddress': ORG_WS_CLAIMS+'emailaddress',
36+
'givenName': ORG_WS_CLAIMS+'givenname',
37+
'group': CLAIMS+'group',
38+
'groupSid': MS_CLAIMS+'groupsid',
39+
'name': ORG_WS_CLAIMS+'name',
40+
'nameId': ORG_WS_CLAIMS+'nameidentifier',
41+
'primaryGroupSid': MS_CLAIMS+'primarygroupsid',
42+
'primarySid': MS_CLAIMS+'primarysid',
43+
'privatePersonalId': ORG_WS_CLAIMS+'privatepersonalidentifier',
44+
'role': MS_CLAIMS+'role',
45+
'surname': ORG_WS_CLAIMS+'surname',
46+
'upn': ORG_WS_CLAIMS+'upn',
47+
'windowsAccountName': MS_CLAIMS+'windowsaccountname',
4648
}
4749
}

0 commit comments

Comments
 (0)