服务提供者(Spring Security SAML)如何以及何时验证断言是否过期?我在and应用程序中创建并配置了一个服务提供商。我的身份提供者是ADFS2.0,进行身份验证并返回带有断言的SAML-response。这个断言有一个带有"NotBefore“和"NotOnOrAfter”标志的"Condition“。到目前为止,我的断言的有效期为1分钟。
当我通过身份验证时,我的客户端会话的有效期为10分钟。这意味着我的断言将在客户端会话仍然有效时过期。服务提供商是否应检测到我的断言已过期,并因此要求IDP重新进行身份验证?我遗漏了什么?
发布于 2015-10-26 20:29:09
我也遇到过你同样的问题,而且还在调查。这似乎是sp和isp之间的不同时间。你可以测试它扩展WebSSOProfileConsumerImpl,implementing verifyAssertion method.Here it代码注释:
@Override
protected void verifyAssertion(Assertion assertion, AuthnRequest request, SAMLMessageContext context) throws AuthenticationException, SAMLException, org.opensaml.xml.security.SecurityException, ValidationException, DecryptionException {
/*// Verify storage time skew
if (!isDateTimeSkewValid(getResponseSkew(), getMaxAssertionTime(), assertion.getIssueInstant())) {
throw new SAMLException("Assertion is too old to be used, value can be customized by setting maxAssertionTime value " + assertion.getIssueInstant());
}*/
// Verify validity of storage
// Advice is ignored, core 574
verifyIssuer(assertion.getIssuer(), context);
verifyAssertionSignature(assertion.getSignature(), context);
// Check subject
if (assertion.getSubject() != null) {
verifySubject(assertion.getSubject(), request, context);
} else {
throw new SAMLException("Assertion does not contain subject and is discarded");
}
// Assertion with authentication statement must contain audience restriction
if (assertion.getAuthnStatements().size() > 0) {
//verifyAssertionConditions(assertion.getConditions(), context, true);
for (AuthnStatement statement : assertion.getAuthnStatements()) {
if (request != null) {
verifyAuthenticationStatement(statement, request.getRequestedAuthnContext(), context);
} else {
verifyAuthenticationStatement(statement, null, context);
}
}
} else {
verifyAssertionConditions(assertion.getConditions(), context, false);
}
}https://stackoverflow.com/questions/33342414
复制相似问题