Users are able to log in correctly using SAML into Strategy Web / Library / Mobile. However, after a period of inactivity causing the web server session to time out, the user attempt to log into Strategy again and SAML authentication fail with the following error on the interface:
"Error in login" Please contact your administrator
Caused by: org.springframework.security.authentication.CredentialsExpiredException: Authentication statement is too old to be used with value "timestamp"
The Identity Provider (IDP) is re-using information that the user has authenticated earlier (indicated by the "Authentication Instant" in the SAML response) and, by default, Spring SAML is configured to prevent users from login if the authentication instant is older than 7200 seconds. More precisely, the web server session has expired and therefore, the Service Provider (SP), here Strategy Web / Library / Mobile, issues a new SAML authentication request and redirects the user to the IDP in order to retrieve a new SAML assertion. The IDP assertion is still valid, and therefore the IDP returns a new SAML response though with the original authentication instant - which is too old for the default configuration of Spring SAML.
Increase the
maxAuthenticationAgeto be equal to or larger than the assertion validity time of the IDP.
<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl"/>
maxAuthenticationAgeas follows and adjust the value (seconds) to the assertion validity time of your Identity Provider:
<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl"> <property name="maxAuthenticationAge" value="xxx"/> </bean>
restful-api-1.0-SNAPSHOT-jar-with-dependencies.jarin the
WEB-INF/libof the Strategy Library file directory.
SpringSAMLConfig.xmlat
auth/SAMLinside the jar.
WEB-INF/classes/auth/SAMLwith your other SAML configuration files. Now any modification of the file will take precedence over the original file inside the jar.
<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl"> </bean>
<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl"> <property name="maxAuthenticationAge" value="xxx"/> </bean>
\MicroStrategyLibrary\WEB-INF\lib.
restful-api-1.0-SNAPSHOT-jar-with-dependencies.jar.
restful-api-1.0-SNAPSHOT-jar-with-dependencies.jar, navigate to
auth/custom.
SAMLConfig.xml.
SAMLConfig.xmlto your desktop to extract it from the jar file.
SAMLConfig.xmlin a text editor.
<beans/>closing tag (last line), paste the code:
<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl"> <property name="maxAuthenticationAge" value="xxx"/> </bean>
valueparameter to contain the actual authentication age in seconds. For example, use
value="3600"for one hour.
SAMLConfig.xml.
\MicroStrategyLibrary\WEB-INF\classes\auth.
custom.
SAMLConfig.xmlfile from step 11 to the
customfolder created in step 13.