Fix: Remove validUntil attribute from SAML SP Metadata#5914
Fix: Remove validUntil attribute from SAML SP Metadata#5914jdede wants to merge 1 commit intoBookStackApp:developmentfrom
Conversation
|
Thanks @jdede and sorry for the delay in response.
Have you experienced this in other real-world scenarios outside of shibboleth? Just want to validate that statement to understand how problematic this is, since this isn't something I've seen be raised as an issue before. Again, I'm wary of changing defaults to suit issues found on a specific identity provider. |
|
As far as I understand, there are two different ways of thinking:
Therefore, I would like to have it configurable depending on the used identity provider. |
|
I'm not really sure what's stopping either approach with an IDP though. In your original issue, how is the BookStack metadata being used? Is it being re-pulled by Shibboleth frequently? Or was this from manual upload? |
This PR disables the
validUntilattribute in the generated SAML Service Provider (SP) metadata.Why this is needed
Currently, the underlying
php-samllibrary hardcodes the metadata validity (TIME_VALID) to 2 days and caching (TIME_CACHED) to 1 week (Source: Metadata.php).In many real-world scenarios, specifically with Identity Providers like Shibboleth, these default windows are too short. This causes the IdP to deny connections or require manual metadata refreshes once the hardcoded time passes.
The
getSPMetadatafunction in Settings.php allows for an$ignoreValidUntilparameter.getSPMetadatacall to set$ignoreValidUntiltotrue.validUntiltimestamp from the XML generated at<URL>/saml2/metadata, preventing arbitrary expiration issues.