Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring安全SAML断言已过期_Spring_Spring Security_Saml 2.0_Spring Saml_Service Provider - Fatal编程技术网

Spring安全SAML断言已过期

Spring安全SAML断言已过期,spring,spring-security,saml-2.0,spring-saml,service-provider,Spring,Spring Security,Saml 2.0,Spring Saml,Service Provider,服务提供者(SpringSecuritySAML)如何以及何时验证断言是否过期? 我已在Web应用程序中创建并配置了服务提供商。 我的身份提供者是ADFS 2.0,它进行身份验证并返回带有断言的SAML响应。这个断言有一个带有“NotBefore”和“notorafter”标志的“Condition”。到目前为止,我的断言有效期为1分钟 当我通过身份验证时,我的客户端会话有效期为10分钟。这意味着我的断言将在客户端会话仍然有效时过期。服务提供商是否应该检测到我的断言已过期,并因此要求IDP重新验

服务提供者(SpringSecuritySAML)如何以及何时验证断言是否过期? 我已在Web应用程序中创建并配置了服务提供商。 我的身份提供者是ADFS 2.0,它进行身份验证并返回带有断言的SAML响应。这个断言有一个带有“NotBefore”和“notorafter”标志的“Condition”。到目前为止,我的断言有效期为1分钟


当我通过身份验证时,我的客户端会话有效期为10分钟。这意味着我的断言将在客户端会话仍然有效时过期。服务提供商是否应该检测到我的断言已过期,并因此要求IDP重新验证?我遗漏了什么?

我面对着你同样的问题,仍在调查。sp和isp之间的时间似乎不同。 您可以通过扩展WebSoProfileConsumerImpl来测试它,实现verifyAssertion方法。下面是代码注释:

@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);
    }

}

嗯,我还是不明白。如果我验证并等待大约5分钟。我的断言将无效,但我的客户端会话有效。如果我在浏览器中刷新网页,那么不应该触发方法verifyAssertion吗?我猜,但我不确定,如果服务器使您的身份验证过期,您需要再次登录。服务器保留您的身份验证的时间可能为1分钟。登录后,您可以在SpringSAML的索引页面中看到会话有效性。