@@ -159,16 +159,6 @@ Since *to* in most cases is the inverse of the *fro* file, the
159159software allows you only to specify one of them, and it will
160160automatically create the other.
161161
162- cert_file
163- ^^^^^^^^^
164-
165- Example::
166-
167- cert_file: "cert.pem"
168-
169- This is the public part of the service private/public key pair.
170- *cert_file * must be a PEM formatted file with a single certificate.
171-
172162contact_person
173163^^^^^^^^^^^^^^
174164
@@ -228,6 +218,30 @@ Example::
228218of the service. This is currently used both to encrypt/sign assertions and as
229219the client key in an HTTPS session.
230220
221+ cert_file
222+ ^^^^^^^^^
223+
224+ Example::
225+
226+ cert_file: "cert.pem"
227+
228+ This is the public part of the service private/public key pair.
229+ *cert_file * must be a PEM formatted file with a single certificate.
230+
231+
232+ encryption_keypairs
233+ ^^^^^^^^^^^^^^^^^^^
234+
235+ Indicates which certificates will be used for encryption capabilities::
236+
237+ # Encryption
238+ 'encryption_keypairs': [
239+ {
240+ 'key_file': BASE_DIR + '/certificates/private.key',
241+ 'cert_file': BASE_DIR + '/certificates/public.cert',
242+ },
243+ ],
244+
231245metadata
232246^^^^^^^^
233247
@@ -258,6 +272,11 @@ For example::
258272 "cert": "ukfederation-mdq.pem",
259273 "freshness_period": "P0Y0M0DT2H0M0S",
260274 },
275+ {
276+ "url": "https://mdq.thaturl.org/",
277+ "disable_ssl_certificate_validation": True,
278+ "check_validity": False,
279+ },
261280 ],
262281 },
263282
@@ -269,6 +288,12 @@ metadata signing certificates should be used. These public keys must be
269288acquired by some secure out-of-band method before being placed on the local
270289file system.
271290
291+ When the parameter *check_validity * is set to False metadata that have expired
292+ will be accepted as valid.
293+
294+ When the paramenter *disable_ssl_certificate_validation * is set to True the
295+ validity of ssl certificate will be skipped.
296+
272297When using MDQ, the `freshness_period ` option can be set to define a period for
273298which the metadata fetched from the the MDQ server are considered fresh. After
274299that period has passed the metadata are not valid anymore and must be fetched
@@ -382,6 +407,13 @@ difference you are prepared to accept.
382407.. note :: This will indiscriminately affect all time comparisons.
383408 Hence your server may accept a statement that in fact is too old.
384409
410+ allow_unknown_attributes
411+ """"""""""""""""""""""""
412+
413+ Indicates that attributes that are not recognized (they are not configured in
414+ attribute-mapping), will not be discarded.
415+ Default to False.
416+
385417xmlsec_binary
386418^^^^^^^^^^^^^
387419
@@ -435,6 +467,11 @@ sign_response
435467Specifies if the IdP should sign the authentication response or not. Can be
436468True or False. Default is False.
437469
470+ want_authn_requests_only_with_valid_cert
471+ """"""""""""""""""""""""""""""""""""""""
472+
473+ When verifying a signed AuthnRequest ignore the signature and verify the
474+ certificate.
438475
439476policy
440477""""""
@@ -599,7 +636,7 @@ metadata of an entity.
599636Example::
600637
601638 "service": {
602- "idp ": {
639+ "sp ": {
603640 "name_id_format": [
604641 "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
605642 "urn:oasis:names:tc:SAML:2.0:nameid-format:transient",
@@ -622,7 +659,6 @@ Example::
622659 }
623660 }
624661
625-
626662hide_assertion_consumer_service
627663"""""""""""""""""""""""""""""""
628664
@@ -881,6 +917,19 @@ Example::
881917 },
882918 },
883919
920+ only_use_keys_in_metadata
921+ """""""""""""""""""""""""
922+
923+ If set to False, the certificate contained in a SAML message will be used for
924+ signature verification.
925+ Default True.
926+
927+ validate_certificate
928+ """"""""""""""""""""
929+
930+ Indicates that the certificate used in sign SAML messages must be valid.
931+ Default to False.
932+
884933logout_requests_signed
885934""""""""""""""""""""""
886935
@@ -1045,4 +1094,55 @@ Other considerations
10451094
10461095Entity Categories
10471096-----------------
1048- Entity categories and their attributes are defined in src/saml2/entity_category/<registrar of entcat>.py
1097+
1098+ Entity categories and their attributes are defined in
1099+ src/saml2/entity_category/<registrar-of-entity-category>.py.
1100+ We can configure Entity Categories in pysaml2 in two ways:
1101+
1102+ 1. Using the configuration options *entity_category_support * or
1103+ *entity_category *, to generate the appropriate EntityAttribute metadata
1104+ elements.
1105+ 2. Using the configuration option *entity_categories * as part of the policy
1106+ configuration, to make the entity category work as a filter on the
1107+ attributes that will be released.
1108+
1109+ If the entity categories are configured as metadata, as follow::
1110+
1111+ 'debug' : True,
1112+ 'xmlsec_binary': get_xmlsec_binary([/usr/bin/xmlsec1']),
1113+ 'entityid': '%s/metadata' % BASE_URL,
1114+
1115+ # or entity_category: [ ... ]
1116+ 'entity_category_support': [
1117+ edugain.COCO, # "http://www.geant.net/uri/dataprotection-code-of-conduct/v1"
1118+ refeds.RESEARCH_AND_SCHOLARSHIP,
1119+ ],
1120+
1121+ 'attribute_map_dir': 'data/attribute-maps',
1122+ 'description': 'SAML2 IDP',
1123+
1124+ 'service': {
1125+ 'idp': {
1126+ ...
1127+
1128+ In the metadata we'll then have::
1129+
1130+ <md:Extensions>
1131+ <mdattr:EntityAttributes>
1132+ <saml:Attribute Name="http://macedir.org/entity-category-support" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
1133+ <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">http://www.geant.net/uri/dataprotection-code-of-conduct/v1</saml:AttributeValue>
1134+ <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">http://refeds.org/category/research-and-scholarship</saml:AttributeValue>
1135+ </saml:Attribute>
1136+ </mdattr:EntityAttributes>
1137+
1138+ If the entity categories are configurated in the policy section, they will act
1139+ as filters on the released attributes.
1140+
1141+ Example::
1142+
1143+ "policy": {
1144+ "default": {
1145+ "lifetime": {"minutes": 15},
1146+ # if the SP is not conform to entity_categories
1147+ # the attributes will not be released
1148+ "entity_categories": ["refeds",],
0 commit comments