@@ -517,39 +517,47 @@ policy
517517""""""
518518
519519If the server is an IdP and/or an AA, then there might be reasons to do things
520- differently depending on who is asking; this is where that is specified.
521- The keys are 'default' and SP entity identifiers. Default is used whenever
522- there is no entry for a specific SP. The reasoning is also that if there is
523- no default and only SP entity identifiers as keys, then the server will only
524- accept connections from the specified SPs.
520+ differently depending on who is asking (which is the requesting service); the
521+ policy is where this behaviour is specified.
522+
523+ The keys are SP entity identifiers, Registration Authority names, or 'default'.
524+ First, the policy for the requesting service is looked up using the SP entityID.
525+ If no such policy is found, and if the SP metadata includes a Registration
526+ Authority then a policy for the registration authority is looked up using the
527+ Registration Authority name. If no policy is found, then the 'default' is looked
528+ up. If there is no default and only SP entity identifiers as keys, then the
529+ server will only accept connections from the specified SPs.
530+
525531An example might be::
526532
527533 "service": {
528534 "idp": {
529535 "policy": {
530- "default": {
531- "lifetime": {"minutes":15},
532- "attribute_restrictions": None, # means all I have
533- "name_form": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri",
534- "entity_categories": ["edugain"]
535- },
536+ # a policy for a service
536537 "urn:mace:example.com:saml:roland:sp": {
537538 "lifetime": {"minutes": 5},
538539 "attribute_restrictions": {
539540 "givenName": None,
540541 "surName": None,
541542 },
542543 },
543- "registration_authorities": {
544- "default" {
545- "attribute_restrictions": None
544+
545+ # a policy for a registration authority
546+ "http://www.swamid.se/": {
547+ "attribute_restrictions": {
548+ "givenName": None,
546549 },
547- "http://www.swamid.se/": {
548- "attribute_restrictions": {
549- "givenName": None,
550- }
551- }
552- }
550+ },
551+
552+ # the policy for all other services
553+ "default": {
554+ "lifetime": {"minutes":15},
555+ "attribute_restrictions": None, # means all I have
556+ "name_form": "urn:oasis:names:tc:SAML:2.0:attrname-format:uri",
557+ "entity_categories": [
558+ "edugain",
559+ ],
560+ },
553561 }
554562 }
555563 }
@@ -573,11 +581,12 @@ An example might be::
573581 the friendly name, and the saml attribute name will be taken from the uri/oid
574582 defined in the attribute map.
575583*nameid_format *
576- Which nameid format that should be used. Defaults to urn:oasis: names:tc: SAML:2.0:nameid-format: transient.
584+ Which nameid format that should be used. Defaults to
585+ `urn:oasis:names:tc:SAML:2.0:nameid-format:transient `.
577586*entity_categories *
578587 Entity categories to apply.
579588*sign *
580- Possible choices: "sign": [" response", "assertion", "on_demand"]
589+ Possible choices: "response", "assertion", "on_demand"
581590
582591If restrictions on values are deemed necessary, those are represented by
583592regular expressions.::
0 commit comments