Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve SP contacts #367

Merged
merged 2 commits into from
Nov 27, 2021
Merged

Conversation

mauromol
Copy link
Contributor

@mauromol mauromol commented Nov 5, 2021

This change adds the ability to specify all data for the Service Provider contacts.

However, it maintains backward compatibility with the old limited support offered for the technical and support contact given name and e-mail address only, although documentation now suggests a more comprehensive approach.

Having the ability to specify rich data for contact types is a key feature required to implement SPID.

This PR also fixes the contact settings validation described in #353.

It's now possible to specify an arbitrary number of contacts, with all
the information supported by the SAML 2.0 specification, including
multiple e-mail addresses and multiple phone numbers per contact. Since
this is indeed information related to the Service Provider (which
appears in the SP metadata), the new (indexed) properties used to
declare contacts have been put in the "onelogin.saml2.sp" namespace and
their parsing uses the same technique used to support multiple Attribute
Consuming Services.
The legacy way to specify just a technical and a support contacts is
still supported (these "legacy" contacts are appended as the last two
ones). The Contact class has been enhanced to support all ContactType
attributes supported by the SAML 2.0 specification but still exposes the
old constructor and single e-mail address getter (although being
deprecated) to provide a 100% backward compatible API.

Fixes SAML-Toolkits#326.
The contact type check now becomes useful (and so it was restored),
because with the new full Contacts support the user may indeed specify
invalid contact types in settings.
The "not enough data" check, instead, was fixed and it is now raised
only if ALL of the contact data (company, given name, surname, e-mail
addresses and phone names) are empty, reflecting the actual SAML 2.0
metadata schema constraint.

Fixes SAML-Toolkits#353.
@mauromol mauromol changed the title Improve sp contacts Improve SP contacts Nov 5, 2021
@pitbulk pitbulk merged commit 1198878 into SAML-Toolkits:master Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants