@@ -16,29 +16,37 @@ The basic structure of the configuration file is therefore like this::
16
16
from saml2 import BINDING_HTTP_REDIRECT
17
17
18
18
CONFIG = {
19
- "entityid" : "http://saml.example.com:saml/idp.xml",
20
- "name" : "Rolands IdP",
19
+ "entityid": "http://saml.example.com:saml/idp.xml",
20
+ "name": "Rolands IdP",
21
21
"service": {
22
22
"idp": {
23
- "endpoints" : {
24
- "single_sign_on_service" : [
25
- ("http://saml.example.com:saml:8088/sso",
26
- BINDING_HTTP_REDIRECT)],
23
+ "endpoints": {
24
+ "single_sign_on_service": [
25
+ (
26
+ "http://saml.example.com:saml:8088/sso",
27
+ BINDING_HTTP_REDIRECT,
28
+ ),
29
+ ],
27
30
"single_logout_service": [
28
- ("http://saml.example.com:saml:8088/slo",
29
- BINDING_HTTP_REDIRECT)]
31
+ (
32
+ "http://saml.example.com:saml:8088/slo",
33
+ BINDING_HTTP_REDIRECT,
34
+ ),
35
+ ],
30
36
},
31
37
...
32
38
}
33
39
},
34
- "key_file" : "my.key",
35
- "cert_file" : "ca.pem",
36
- "xmlsec_binary" : "/usr/local/bin/xmlsec1",
40
+ "key_file": "my.key",
41
+ "cert_file": "ca.pem",
42
+ "xmlsec_binary": "/usr/local/bin/xmlsec1",
37
43
"delete_tmpfiles": True,
38
44
"metadata": {
39
- "local": ["edugain.xml"],
45
+ "local": [
46
+ "edugain.xml",
47
+ ],
40
48
},
41
- "attribute_map_dir" : "attributemaps",
49
+ "attribute_map_dir": "attributemaps",
42
50
...
43
51
}
44
52
@@ -93,7 +101,7 @@ A typical map file will look like this::
93
101
'urn:mace:dir:attribute-def:associatedDomain': 'associatedDomain',
94
102
'urn:mace:dir:attribute-def:associatedName': 'associatedName',
95
103
...
96
- },
104
+ },
97
105
"to": {
98
106
'aRecord': 'urn:mace:dir:attribute-def:aRecord',
99
107
'aliasedEntryName': 'urn:mace:dir:attribute-def:aliasedEntryName',
@@ -135,19 +143,22 @@ about the service or if support is needed. The possible types are according to
135
143
the standard **technical **, **support **, **administrative **, **billing **
136
144
and **other **.::
137
145
138
- contact_person: [{
139
- "givenname": "Derek",
140
- "surname": "Jeter",
141
- "company": "Example Co.",
142
-
143
- "type": "technical",
144
- },{
145
- "givenname": "Joe",
146
- "surname": "Girardi",
147
- "company": "Example Co.",
148
-
149
- "type": "administrative",
150
- }]
146
+ contact_person: [
147
+ {
148
+ "givenname": "Derek",
149
+ "surname": "Jeter",
150
+ "company": "Example Co.",
151
+
152
+ "type": "technical",
153
+ },
154
+ {
155
+ "givenname": "Joe",
156
+ "surname": "Girardi",
157
+ "company": "Example Co.",
158
+
159
+ "type": "administrative",
160
+ },
161
+ ]
151
162
152
163
debug
153
164
^^^^^
@@ -193,7 +204,7 @@ Contains a list of places where metadata can be found. This can be
193
204
194
205
For example::
195
206
196
- "metadata" : {
207
+ "metadata": {
197
208
"local": [
198
209
"/opt/metadata"
199
210
"metadata.xml",
@@ -222,24 +233,33 @@ metadata signing certificates should be used. These public keys must be
222
233
acquired by some secure out-of-band method before being placed on the local
223
234
file system.
224
235
225
- When using MDQ, the `freshness_period ` option can be set to define
226
- a period for which the metadata fetched from the the MDQ server are considered
227
- fresh. After that period has passed the metadata are not valid anymore and must
228
- be fetched again. The period must be in the format defined in `iso 8601 <https://www.iso.org/iso-8601-date-and-time-format.html >`_.
236
+ When using MDQ, the `freshness_period ` option can be set to define a period for
237
+ which the metadata fetched from the the MDQ server are considered fresh. After
238
+ that period has passed the metadata are not valid anymore and must be fetched
239
+ again. The period must be in the format defined in
240
+ `ISO 8601 <https://www.iso.org/iso-8601-date-and-time-format.html >`_
241
+ or `RFC3999 <https://tools.ietf.org/html/rfc3339#appendix-A >`_.
229
242
230
243
By default, if `freshness_period ` is not defined, the metadata are refreshed
231
244
every 12 hours (`P0Y0M0DT12H0M0S `).
232
245
246
+
233
247
organization
234
248
^^^^^^^^^^^^
235
249
236
250
Only used by *make_metadata.py *.
237
251
Where you describe the organization responsible for the service.::
238
252
239
253
"organization": {
240
- "name": [("Example Company","en"), ("Exempel AB","se")],
254
+ "name": [
255
+ ("Example Company", "en"),
256
+ ("Exempel AB", "se")
257
+ ],
241
258
"display_name": ["Exempel AB"],
242
- "url": [("http://example.com","en"),("http://exempel.se","se")],
259
+ "url": [
260
+ ("http://example.com", "en"),
261
+ ("http://exempel.se", "se"),
262
+ ],
243
263
}
244
264
245
265
.. note :: You can specify the language of the name, or the language used on
@@ -289,14 +309,22 @@ So if a server is a Service Provider (SP) then the configuration
289
309
could look something like this::
290
310
291
311
"service": {
292
- "sp":{
293
- "name" : "Rolands SP",
294
- "endpoints":{
312
+ "sp": {
313
+ "name": "Rolands SP",
314
+ "endpoints": {
295
315
"assertion_consumer_service": ["http://localhost:8087/"],
296
- "single_logout_service" : [("http://localhost:8087/slo",
297
- 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect')],
316
+ "single_logout_service": [
317
+ (
318
+ "http://localhost:8087/slo",
319
+ 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
320
+ ),
321
+ ],
298
322
},
299
- "required_attributes": ["surname", "givenname", "edupersonaffiliation"],
323
+ "required_attributes": [
324
+ "surname",
325
+ "givenname",
326
+ "edupersonaffiliation",
327
+ ],
300
328
"optional_attributes": ["title"],
301
329
"idp": {
302
330
"urn:mace:umu.se:saml:roland:idp": None,
@@ -393,7 +421,7 @@ An example might be::
393
421
},
394
422
"urn:mace:example.com:saml:roland:sp": {
395
423
"lifetime": {"minutes": 5},
396
- "attribute_restrictions":{
424
+ "attribute_restrictions": {
397
425
"givenName": None,
398
426
"surName": None,
399
427
}
@@ -429,7 +457,7 @@ regular expressions.::
429
457
"policy": {
430
458
"urn:mace:umu.se:saml:roland:sp": {
431
459
"lifetime": {"minutes": 5},
432
- "attribute_restrictions":{
460
+ "attribute_restrictions": {
433
461
"mail": [".*\.umu\.se$"],
434
462
}
435
463
}
@@ -670,7 +698,11 @@ Example::
670
698
671
699
"service": {
672
700
"sp": {
673
- "required_attributes": ["surname", "givenName", "mail"],
701
+ "required_attributes": [
702
+ "surname",
703
+ "givenName",
704
+ "mail",
705
+ ],
674
706
}
675
707
}
676
708
@@ -717,7 +749,7 @@ Example::
717
749
"sp": {
718
750
"want_response_signed": False,
719
751
"want_assertions_signed": False,
720
- "want_assertions_or_response_signed": True
752
+ "want_assertions_or_response_signed": True,
721
753
}
722
754
}
723
755
@@ -766,11 +798,13 @@ Example::
766
798
767
799
"service":
768
800
"idp": {
769
- "endpoints" : {
770
- "single_sign_on_service" : [
771
- ("http://localhost:8088/sso", BINDING_HTTP_REDIRECT)],
801
+ "endpoints": {
802
+ "single_sign_on_service": [
803
+ ("http://localhost:8088/sso", BINDING_HTTP_REDIRECT),
804
+ ],
772
805
"single_logout_service": [
773
- ("http://localhost:8088/slo", BINDING_HTTP_REDIRECT)]
806
+ ("http://localhost:8088/slo", BINDING_HTTP_REDIRECT),
807
+ ],
774
808
},
775
809
},
776
810
},
@@ -819,9 +853,9 @@ virtual_organization
819
853
820
854
Gives information about common identifiers for virtual_organizations::
821
855
822
- "virtual_organization" : {
823
- "urn:mace:example.com:it:tek":{
824
- "nameid_format" : "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID",
856
+ "virtual_organization": {
857
+ "urn:mace:example.com:it:tek": {
858
+ "nameid_format": "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID",
825
859
"common_identifier": "umuselin",
826
860
}
827
861
},
@@ -839,35 +873,38 @@ We start with a simple but fairly complete Service provider configuration::
839
873
from saml2 import BINDING_HTTP_REDIRECT
840
874
841
875
CONFIG = {
842
- "entityid" : "http://example.com/sp/metadata.xml",
876
+ "entityid": "http://example.com/sp/metadata.xml",
843
877
"service": {
844
- "sp":{
845
- "name" : "Example SP",
846
- "endpoints":{
878
+ "sp": {
879
+ "name": "Example SP",
880
+ "endpoints": {
847
881
"assertion_consumer_service": ["http://example.com/sp"],
848
- "single_logout_service" : [("http://example.com/sp/slo",
849
- BINDING_HTTP_REDIRECT)],
882
+ "single_logout_service": [
883
+ ("http://example.com/sp/slo", BINDING_HTTP_REDIRECT),
884
+ ],
850
885
},
851
886
}
852
887
},
853
- "key_file" : "./mykey.pem",
854
- "cert_file" : "./mycert.pem",
855
- "xmlsec_binary" : "/usr/local/bin/xmlsec1",
888
+ "key_file": "./mykey.pem",
889
+ "cert_file": "./mycert.pem",
890
+ "xmlsec_binary": "/usr/local/bin/xmlsec1",
856
891
"delete_tmpfiles": True,
857
892
"attribute_map_dir": "./attributemaps",
858
893
"metadata": {
859
894
"local": ["idp.xml"]
860
895
}
861
896
"organization": {
862
- "display_name":["Example identities"]
897
+ "display_name": ["Example identities"]
863
898
}
864
- "contact_person": [{
865
- "givenname": "Roland",
866
- "surname": "Hedberg",
867
- "phone": "+46 90510",
868
-
869
- "type": "technical",
870
- }]
899
+ "contact_person": [
900
+ {
901
+ "givenname": "Roland",
902
+ "surname": "Hedberg",
903
+ "phone": "+46 90510",
904
+
905
+ "type": "technical",
906
+ },
907
+ ]
871
908
}
872
909
873
910
This is the typical setup for an SP.
@@ -881,45 +918,51 @@ A slightly more complex configuration::
881
918
from saml2 import BINDING_HTTP_REDIRECT
882
919
883
920
CONFIG = {
884
- "entityid" : "http://sp.example.com/metadata.xml",
921
+ "entityid": "http://sp.example.com/metadata.xml",
885
922
"service": {
886
- "sp":{
887
- "name" : "Example SP",
888
- "endpoints":{
923
+ "sp": {
924
+ "name": "Example SP",
925
+ "endpoints": {
889
926
"assertion_consumer_service": ["http://sp.example.com/"],
890
- "single_logout_service" : [("http://sp.example.com/slo",
891
- BINDING_HTTP_REDIRECT)],
927
+ "single_logout_service": [
928
+ ("http://sp.example.com/slo", BINDING_HTTP_REDIRECT),
929
+ ],
892
930
},
893
931
"subject_data": ("memcached", "localhost:12121"),
894
- "virtual_organization" : {
895
- "urn:mace:example.com:it:tek":{
896
- "nameid_format" : "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID",
932
+ "virtual_organization": {
933
+ "urn:mace:example.com:it:tek": {
934
+ "nameid_format": "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID",
897
935
"common_identifier": "eduPersonPrincipalName",
898
936
}
899
937
},
900
938
}
901
939
},
902
- "key_file" : "./mykey.pem",
903
- "cert_file" : "./mycert.pem",
904
- "xmlsec_binary" : "/usr/local/bin/xmlsec1",
940
+ "key_file": "./mykey.pem",
941
+ "cert_file": "./mycert.pem",
942
+ "xmlsec_binary": "/usr/local/bin/xmlsec1",
905
943
"delete_tmpfiles": True,
906
- "metadata" : {
944
+ "metadata": {
907
945
"local": ["example.xml"],
908
- "remote": [{
909
- "url":"https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2",
910
- "cert":"kalmar2.pem"}]
946
+ "remote": [
947
+ {
948
+ "url":"https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2",
949
+ "cert":"kalmar2.pem",
950
+ }
951
+ ]
911
952
},
912
- "attribute_maps" : "attributemaps",
953
+ "attribute_maps": "attributemaps",
913
954
"organization": {
914
- "display_name":["Example identities"]
955
+ "display_name": ["Example identities"]
915
956
}
916
- "contact_person": [{
917
- "givenname": "Roland",
918
- "surname": "Hedberg",
919
- "phone": "+46 90510",
920
-
921
- "type": "technical",
922
- }]
957
+ "contact_person": [
958
+ {
959
+ "givenname": "Roland",
960
+ "surname": "Hedberg",
961
+ "phone": "+46 90510",
962
+
963
+ "type": "technical",
964
+ },
965
+ ]
923
966
}
924
967
925
968
Uses metadata files, both local and remote, and will talk to whatever
0 commit comments