@@ -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,28 @@ 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+ 'key_file': BASE_DIR + '/certificates/private.key',
240+ 'cert_file': BASE_DIR + '/certificates/public.cert',
241+ }],
242+
231243metadata
232244^^^^^^^^
233245
@@ -258,6 +270,11 @@ For example::
258270 "cert": "ukfederation-mdq.pem",
259271 "freshness_period": "P0Y0M0DT2H0M0S",
260272 },
273+ {
274+ "url": "https://mdq.thaturl.org/",
275+ "disable_ssl_certificate_validation": True,
276+ "check_validity": False
277+ },
261278 ],
262279 },
263280
@@ -269,6 +286,10 @@ metadata signing certificates should be used. These public keys must be
269286acquired by some secure out-of-band method before being placed on the local
270287file system.
271288
289+ When using MDQ or remote, the paramenter *disable_ssl_certificate_validation *
290+ prevents that the validity of ssl certificate involved in the https connection
291+ will be verified. *check_validity * to False accept as valid the metadata that has expired.
292+
272293When using MDQ, the `freshness_period ` option can be set to define a period for
273294which the metadata fetched from the the MDQ server are considered fresh. After
274295that period has passed the metadata are not valid anymore and must be fetched
@@ -382,6 +403,13 @@ difference you are prepared to accept.
382403.. note :: This will indiscriminately affect all time comparisons.
383404 Hence your server may accept a statement that in fact is too old.
384405
406+ allow_unknown_attributes
407+ """"""""""""""""""""""""
408+
409+ Indicates that attributes not configured in attribute-mapping, with
410+ unsupported attribute name format, will not be discarded.
411+ Default to False.
412+
385413xmlsec_binary
386414^^^^^^^^^^^^^
387415
@@ -435,6 +463,9 @@ sign_response
435463Specifies if the IdP should sign the authentication response or not. Can be
436464True or False. Default is False.
437465
466+ want_authn_requests_only_with_valid_cert
467+ """"""""""""""""""""""""""""""""""""""""
468+ This option make mandatory the presence of the SP cert in a (signed) AuthnRequest.
438469
439470policy
440471""""""
@@ -622,7 +653,6 @@ Example::
622653 }
623654 }
624655
625-
626656hide_assertion_consumer_service
627657"""""""""""""""""""""""""""""""
628658
@@ -881,6 +911,19 @@ Example::
881911 },
882912 },
883913
914+ only_use_keys_in_metadata
915+ """""""""""""""""""""""""
916+
917+ If True prevents that the certificate contained in a
918+ SAML message, if present, will be used for signature verification.
919+ Default True.
920+
921+ validate_certificate
922+ """"""""""""""""""""
923+
924+ Indicates that the certificate used in signatures must be valid.
925+ Default to False.
926+
884927logout_requests_signed
885928""""""""""""""""""""""
886929
@@ -1046,3 +1089,46 @@ Other considerations
10461089Entity Categories
10471090-----------------
10481091Entity categories and their attributes are defined in src/saml2/entity_category/<registrar of entcat>.py
1092+ We can configure Entity Categories in pysaml2 in two ways:
1093+
1094+ 1. As EntityAttributes, *entity_category_support * or *entity_category *.
1095+ 2. As Policy, it acts like a filter.
1096+
1097+ Entity Category and Entity Category support can be configured as follow::
1098+
1099+ 'debug' : True,
1100+ 'xmlsec_binary': get_xmlsec_binary([/usr/bin/xmlsec1']),
1101+ 'entityid': '%s/metadata' % BASE_URL,
1102+
1103+ # or entity_category: [ ... ]
1104+ 'entity_category_support': [edugain.COCO, # "http://www.geant.net/uri/dataprotection-code-of-conduct/v1"
1105+ refeds.RESEARCH_AND_SCHOLARSHIP],
1106+
1107+ 'attribute_map_dir': 'data/attribute-maps',
1108+ 'description': 'SAML2 IDP',
1109+
1110+ 'service': {
1111+ 'idp': {
1112+ ...
1113+
1114+ In the metadata we'll then have::
1115+
1116+ <md:Extensions>
1117+ <mdattr:EntityAttributes>
1118+ <saml:Attribute Name="http://macedir.org/entity-category-support" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
1119+ <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>
1120+ <saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">http://refeds.org/category/research-and-scholarship</saml:AttributeValue>
1121+ </saml:Attribute>
1122+ </mdattr:EntityAttributes>
1123+
1124+ If Entity Category would be configured instead in the policy section, as follow, it
1125+ will acts like a filter on the released attributes.
1126+
1127+ Example::
1128+
1129+ "policy": {
1130+ "default": {
1131+ "lifetime": {"minutes": 15},
1132+
1133+ # if the sp are not conform to entity_categories the attributes will not be released
1134+ "entity_categories": ["refeds",],
0 commit comments