Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

SAML authentication failing: SAML token security failure



Sporadically in a staging production environment, a SAML authentication error is received in Pega 7.1.7. 

Error Messages

"Caught Exception while validating SAML2 Authentication response protocol : SAML token security failure"

Caused by: org.apache.wss4j.common.ext.WSSecurityException: SAML token security failure

at com.pega.pegarules.integration.engine.internal.sso.saml.SAMLv2ResponseProtocolValidator.validateAssertion(
at com.pega.pegarules.integration.engine.internal.sso.saml.SAMLv2ResponseProtocolValidator.validate(

Steps to Reproduce

When testing logins attempts, one out of every five attempts, results in the error.

Root Cause

When the login worked the SAMLResponse contained the X509 certificate XML node. When the login failed the SAMLResponse did not contains the X509 certificate. 

The environment has two IDP servers with a load balancer in front of them. One of the IDP servers was missing the configuration option to return the X509 certificate xml node within the SAMLResponse. 



A defect or configuration issue in the operating environment caused the problem.

Once both IDP servers were configured to return the X509 certificate xml node the issue gets resolved. 

Pega also provided two patches to client to reach to the latest PRPC SAML code for Pega 7.1.7:  Hfix-20958, Hfix-22795.

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us