CAS服务器SAML 1.1身份验证得到空响应

时间:2016-03-29 05:27:06

标签: authentication saml cas phpcas

CAS服务器SAML 1.1身份验证获得空响应

我们长期以来一直为CAS SAML 1.1协议带来痛苦。

我们使用的是phpCAS,这是一个CAS客户端库。

我们正在使用协议SAML 1.1来获取用户属性,例如用户电子邮件。

但是,它因空响应错误而失败。

这是客户端日志:(它是交互日志的一部分,有点长,但很容易理解)

3CEE .|    |    |    |    => CAS_Client::_readURL('https://portail.cigref.fr/cas/samlValidate?TARGET=https%3A%2F%2Frfly-99.cvtest.com%2Fztest%2FphpCAS%2Fdocs%2Fexamples%2Fexample_simple.php', NULL, NULL, NULL) [Client.php:2062]
3CEE .|    |    |    |    |    => CAS_Client::_buildSAMLPayload() [Client.php:2806]
3CEE .|    |    |    |    |    <= '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><samlp:Request xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"  MajorVersion="1" MinorVersion="1" RequestID="_192.168.16.51.1024506224022" IssueInstant="2002-06-19T17:03:44.022Z"><samlp:AssertionArtifact>ST-5376-cjRtmnPYQBxIMFWOQY1x-cas01.example.org</samlp:AssertionArtifact></samlp:Request></SOAP-ENV:Body></SOAP-ENV:Envelope>'
3CEE .|    |    |    |    |    => CAS_Request_CurlRequest::sendRequest() [AbstractRequest.php:242]
3CEE .|    |    |    |    |    |    CURL: Set CURLOPT_CAINFO ../../ssl/portail.cigref.fr.pem [CurlRequest.php:132]
3CEE .|    |    |    |    |    |    Response Body: 
3CEE .|    |    |    |    |    |    
3CEE .|    |    |    |    |    |     [CurlRequest.php:84]
3CEE .|    |    |    |    |    <= true
3CEE .|    |    |    |    <= true
3CEE .|    |    |    |    server version: S1 [Client.php:2071]
3CEE .|    |    |    |    dom->loadXML() failed [Client.php:2082]
3CEE .|    |    |    |    => CAS_AuthenticationException::__construct(CAS_Client, 'SA not validated', 'https://portail.cigref.fr/cas/samlValidate?TARGET=https%3A%2F%2Frfly-99.cvtest.com%2Fztest%2FphpCAS%2Fdocs%2Fexamples%2Fexample_simple.php', false, true, '') [Client.php:2087]
3CEE .|    |    |    |    |    => CAS_Client::getURL() [AuthenticationException.php:76]
3CEE .|    |    |    |    |    <= 'https://rfly-99.cvtest.com/ztest/phpCAS/docs/examples/example_simple.php'
3CEE .|    |    |    |    |    CAS URL: https://portail.cigref.fr/cas/samlValidate?TARGET=https%3A%2F%2Frfly-99.cvtest.com%2Fztest%2FphpCAS%2Fdocs%2Fexamples%2Fexample_simple.php [AuthenticationException.php:79]
3CEE .|    |    |    |    |    Authentication failure: SA not validated [AuthenticationException.php:80]
3CEE .|    |    |    |    |    Reason: bad response from the CAS server [AuthenticationException.php:85]
3CEE .|    |    |    |    |    CAS response:  [AuthenticationException.php:101]
3CEE .|    |    |    |    |    exit()
3CEE .|    |    |    |    |    -

故障单有效且已发送有效负载但响应正文为空。

以上日志适用于我们的客户&#39; CAS服务器。

我们在本地CAS服务器上进行了测试,确定无误。

我们还检查了客户&#39; CAS服务器日志是tomcat日志,发现这个:

2016-03-22 03:31:25,647 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - Audit trail record BEGIN

=============================================================

WHO: audit:unknown

WHAT: ST-5376-cjRtmnPYQBxIMFWOQY1x-cas01.example.org

ACTION: SERVICE_TICKET_VALIDATED

APPLICATION: CAS

WHEN: Tue Mar 22 03:31:25 CET 2016

CLIENT IP ADDRESS: 124.127.186.129

SERVER IP ADDRESS: 178.22.130.235

=============================================================



2016-03-22 03:31:25,647 DEBUG [org.jasig.cas.web.ServiceValidateController] - Successfully validated service ticket ST-5376-cjRtmnPYQBxIMFWOQY1x-cas01.example.org for service [https://rfly-99.cvtest.com/ztest/phpCAS/docs/examples/example_simple.php]

票证已经过验证,日志中没有错误,除了一些应该没有关联的注销错误。

这个问题的原因是什么?有人曾经遇到过这个问题吗?请帮助我们。

1 个答案:

答案 0 :(得分:0)

你是不是也要把票传给samlValidate?我只看到TARGET。