CAS认证失败! 使用ohocas客户端时

我用mysql后端设置了rubycas-server。 但是当我尝试通过phpCAS客户端登录时,它被重定向到rubycas-server url。 但是,在输入用户名和&amp; 密码 - 我收到此错误</ p>

CAS身份验证失败!</ p>

您未经过身份验证。</ p>

您可以 再次按此处提交您的请求。</ p>

如果问题仍然存在,您可以联系本网站的管理员。</ p>

您告诉我.. 我的phpcas客户端错误了。请帮助我。</ p>
</ div>

展开原文

原文

I've setup the rubycas-server with mysql backend. But when i tried to login via a phpCAS client, it is redirected to rubycas-server url. but, after entering username & password - I got this error

CAS Authentication failed!

You were not authenticated.

You may submit your request again by clicking here.

If the problem persists, you may contact the administrator of this site.

CAn u tell me...whats wrong with my phpcas client..Please help me.

php

1个回答



当我们不使用 SSL :: setNoCasServerValidation(); </ code时,这是开发服务器通常会遇到的问题 >
但是,即使在使用 setNoCasServerValidation()</ code>之后,CAS客户端也会使用https在内部调用 curl </ code>,这是导致此错误的主要原因。</ p>
\ n

所以要修复它只需转到CAS库文件 ../ CAS / CAS / Client.php </ code>
到达函数</ p>

  private 函数_readURL($ url,&amp; $ headers,&amp; $ body,&amp; $ err_msg){} 
</ code> </ pre>

并添加此行</ p>

$ url = str_replace(“https”,“http”,$ url);
</ code> </ pre>

作为第一行函数 _readURL(... </ code> </ p>

请不要在生产环境中执行此操作,因为CAS建议在生产环境中使用SSL。</ p>
</ div>

展开原文

原文

This is the problem which generally comes with the development servers when we use no SSL::setNoCasServerValidation(); However even after using setNoCasServerValidation(), the CAS Client internally calls the curl using https, which is the main cause of this error.

So to fix it just go to CAS Library file ../CAS/CAS/Client.php Reach the function

private function _readURL($url, &$headers, &$body, &$err_msg){}

and add this line

$url = str_replace("https", "http", $url);

as the first line of function _readURL(...

Please don't do this in production environment as CAS recommends use of SSL on production.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问