Files: conf/idp.properties, conf/intercept/consent-intercept-config.xml, messages/message.properties, views/intercept/attribute-release.vm, views/intercept/terms-of-use.vm
Format: Native Spring
Consent is implemented by the
intercept/terms-of-use interceptor flows.
Enabling Module (V4.1+)
For V4.1+, configuring and using this feature requires that you first enable the "idp.intercept.Consent" module if it isn't already enabled. Systems upgraded from older releases generally come pre-enabled due to the prior state of the configuration tree.
Attribute Release Consent
Attribute release consent requires users to accept the release of attributes to Service Providers during front-channel authentication profiles that include attribute data in the response.
Note the "front-channel" caveat above. The default configuration prevents the consent intercept from imposing itself if it detects that attributes would not be included in the response and would instead perhaps be accessed via a back-channel query. This is true by default with SAML 1.1, for example.
The system does support the limited application of prior consent decisions by a user to the data released in a back-channel query, though this is disabled by default.
If you intend to use the consent feature and do not enable this support, it is your responsibility to ensure that attributes would not be accessible to the same relying parties via query or some other means. The system will not prevent this from happening if you leave features enabled that would allow this to happen.
Users are prompted to consent to attribute release :
on initial access to service provider resources
on release of an attribute to which consent has not been previously given
when an attribute previously consented to is no longer released
(optionally) when the value of an attribute previously consented to changes, see ConsentConfiguration#Attribute Release Value Comparison.
Attribute release consent is enabled for profiles that do user authentication via the
postAuthenticationFlows property in conf/relying-party.xml.
Default relying party configuration
To allow users to select the attributes they wish to be released, provided the attributes are not being released via a back-channel exchange, you can set the idp.consent.allowPerAttribute property in conf/idp.properties.
When a user rejects consent to attribute release, an
AttributeReleaseRejected event will be signalled. The text presented to the user may be modified via standard ErrorHandlingConfiguration and via messages/messages.properties (see the Messages tab below).
The names and values of attributes displayed during consent may be customized. By default, the locale-aware attribute display name and display value are displayed. Customizing the localization information is generally handled through the rules defined in the AttributeRegistryConfiguration.
By default, users are prompted to consent to release all attributes unless specifically suppressed on a per-attribute basis. Suppressed attributes are released to relying parties but are not displayed to users. A prompted list, ignored list, and match expressions determine whether consent should be obtained for an attribute based on the attribute ID.
To prevent an attribute from being displayed, add the attribute ID to the ignored list or exclude it by a match expression. The ignored list and match expression override the prompted list.
Bean name conf/intercept/consent-intercept-config.xml
Attribute IDs for which users should be prompted to consent
Attribute IDs for which users should not be prompted to consent
Attribute IDs matching a regular expression that users should be prompted to consent
Attributes are, by default, displayed in the natural order of their IDs. Deployers may wish to customize the order in which attributes are displayed to users, in order to present the most relevant or personal attributes first.
The order in which attributes are displayed to users may be customized by providing a list of attribute IDs. Attributes not in the list will still be sorted in their natural order, but subsequent to attributes in the list. Define the bean named shibboleth.consent.attribute-release.AttributeDisplayOrder in conf/intercept/consent-intercept-config.xml representing the desired order. The values of the list are attribute IDs.
The following example displays the
For advanced customization of the attribute display order, a custom Comparator may be provided. Define a bean named shibboleth.consent.attribute-release.AttributeIDComparator in conf/intercept/consent-intercept-config.xml which implements Comparator<String>. For example:
Users may choose from three options when deciding the duration of their consent to attribute release. The duration options and descriptive text may be customized via messages/messages.properties.
"Ask me again at next login"
Users will be prompted to consent to attribute release at every log in. This is implemented by not storing consent.
"Ask me again if information to be provided to this service changes"
The default. Users will be prompted to consent to attribute release if attributes have changed since consent was previously given.
"Do not ask me again"
Optional. Users will not be prompted to consent to attribute release again. All attributes will be released to any service provider. The presence of this option is controlled by the idp.consent.allowGlobal property.
By default, users are prompted to consent to attribute release if a "new" attribute is released or if an "old" attribute is no longer released. "New" and "old" in this context indicate whether consent has already been given to an attribute ID regardless of the attribute's values. In other words, by default, users are not prompted to consent to attribute release if an attribute's values change.
To prompt users to consent to attribute release if the values of an attribute have changed, set idp.consent.compareValues to true in conf/idp.properties
Prompting users to consent to attribute release if an attribute's value changes requires additional storage capability, because the hash of an attribute's values must be stored for comparison. If client-side storage without use of HTML Local Storage is used to store consent, comparing attribute values may reduce the number of records that may be stored. Since a consent record is stored for every Service Provider, this may increase how often users are prompted to consent to attribute release
The "terms" are managed as Spring messages via the messages/messages.properties file (or localized versions of it) (see ConsentConfiguration#Messages).
To enable the flow, you would add
terms-of-use to the
postAuthenticationFlows profile setting in conf/relying-party.xml.
For example for use with SAML 2.0 requests, replace:
TermsRejected event will be signaled. The text presented to the user may be modified via standard ErrorHandlingConfiguration and via messages/messages.properties (see ConsentConfiguration#Messages).
The templates can be customized in a similar way to the login pages and other views.
Messages displayed to users may be localized in the standard Spring way, for example, by providing messages/messages_de.properties. Some translations are already included in the distribution.
Users may revoke previous consent choices by selecting a checkbox on the login page (views/login.vm).
The text of the checkbox displayed on the login page is set by the idp.attribute-release.revoke message ID, overridable in messages/messages.properties.
In order to remember users' consent choices and to prompt users to consent to attribute release if attributes change, users' consent choices must be persisted by a storage service. User consent may be stored either client-side (cookies or HTML5 Local Storage) or server-side (database). The default is to store consent client-side via Local Storage, not out of any particular belief that it makes sense, but because it allows easy deployment of the feature for demonstration.
The storage service used to store consent is configured by the idp.consent.StorageService property in conf/idp.properties
See StorageConfiguration for more on the configuration of various approaches to storage.
If server-side storage is used, the number of stored consent records should probably be unlimited, represented by a limit of -1 or 0.
The maximum number of stored consent records is configured via the idp.consent.maxStoredRecords property in conf/idp.properties
A map is supported to store numbers which refer to attribute IDs in order to reduce the size of consent storage records if desired. The default mapping of attribute IDs to numbers is defined by the shibboleth.consent.DefaultAttributeSymbolics bean, internally to the system.
Additional mappings may be added to the shibboleth.consent.AttributeSymbolics bean in conf/intercept/consent-intercept-config.xml
The default lifetime for consent storage records is 1 year, and may be configured via idp.consent.storageRecordLifetime in conf/idp.properties. When consent storage records expire, they will no longer by visible via the storage service. Actual timing of deletion is specific to the storage implementation.
The below information is provided for reference but is not a public interface of the system. You may not depend on the format remaining unchanged across even patch releases.
Consent storage records consist of a key and value, like all StorageRecords.
The (default) storage key for consent records is a concatenation of the user key and the relying party ID, though this is customizeable.
The storage value for consent records is the JSON-serialized form of a Map of Consent objects.
A per-user index is maintained in order to expire or limit the number of stored records.
By default, consent audit logs are written to logs/idp-consent-audit.log as defined in conf/logback.xml.
The format of consent audit logs are defined by the shibboleth.consent.attribute-release.AuditFormattingMap and shibboleth.consent.terms-of-use.AuditFormattingMap beans in conf/intercept/consent-intercept-config.xml
Consent flows (like any other interceptor flow) may be run conditionally based on ActivationConditions.
Because the attribute release flow has an internal condition attached already, customizing the condition for it requires combining the default activation condition with the custom activation condition. By default, the attribute release flow is not activated if both (1) attributes are not pushed and (2) per attribute consent is enabled.
Consent flows may be activated based on the presence (or absence) of a particular attribute or value for a user.
The following example activates the attribute release flow if an attribute is present by combining the default activation condition with a custom condition:
Example activation condition in conf/intercept/profile-intercept.xml
To combine your own condition with the system default, you would define your bean in, e.g., conf/global.xml:
Custom condition bean in global.xml
Then define the property idp.consent.attribute-release.activationCondition to example.AttributeReleaseCondition (your custom bean's ID) to install it and it will be combined with the system's default condition for you
Beans defined, or expected to be defined, in conf/intercept/consent-intercept-config.xml :
Bean ID / Type
Function which returns the key which is concatenated with the user key to lookup storage records, defaults to the relying party ID.
Overriding this bean allows a single consent record to cover multiple Relying Parties.
List of attribute IDs for which consent should be obtained
List of attribute IDs for which consent should not be obtained
Regular expression matching the attribute IDs for which consent should be obtained
Attribute release audit log format, maps logger name to audit fields
Audit fields in addition to the default fields populated at the start of the consent flow
Audit fields in addition to the default fields used when writing the audit log
Limits storage record size by mapping attribute IDs to numbers
Default map that can be used as a parent bean for the bean above to merge in additional values
Condition that determines whether to apply prior consent decisions in server-side storage to back-channel query requests. Defaults to FALSE.
Relevant properties defined in conf/idp.properties :
Name of storage service used to store users' consent choices
Name of function used to return the String storage key representing a user, defaults to the principal name
Replacement for "idp.consent.userStorageKey" specific to attribute-release flow
Replacement for "idp.consent.userStorageKey" specific to terms-of-use flow
Attribute whose value is the storage key representing a user, only used when idp.consent.userStorageKey = shibboleth.consent.AttributeConsentStorageKey
Replacement for "idp.consent.userStorageKeyAttribute" specific to attribute-release flow
Replacement for "idp.consent.userStorageKeyAttribute" specific to terms-of-use flow
Optional condition to apply to control activation of attribute-release flow along with system default behavior
Optional condition to apply to control activation of terms-of-use flow
Whether not remembering/storing consent is allowed
Whether consent to any attribute and to any relying party is allowed
Whether per-attribute consent is allowed
Maximum number of records stored when using space-limited storage (e.g. cookies), 0 = no limit
Maximum number of records stored when using larger/server-side storage, 0 = no limit
Time in milliseconds to expire consent storage records
Relevant messages overridable via messages/messages.properties:
Title of error page displayed when attribute release consent is rejected
Text of error page displayed when attribute release consent is rejected
An IdP can be upgraded to the current version without any changes, but there are issues around the sorting and hashing of attribute values that may cause unexpected re-prompting for consent even when the actual values of an attribute haven't changed.
V4.1 resolves this bug going forward but cannot correct the issue retroactively.
Prior to V4.1, avoiding use of consent with multi-valued attributes is one workaround.