参照文章
https://www.cnblogs.com/zhenyulu/archive/2013/01/22/2870936.html
简单说一下流程
1.引用DotNetCasClient
开源地址:https://github.com/apereo/dotnet-cas-client
测试环境引用,正式环境编译成dll引用
2.配置自己工程的web.config
详见上述两个网址的例子。
碰到的问题及解决:
1.按照网上的说明配置完之后,一直不向cas登录页跳转,发现是authorization中配置的是allow,应该是deny
<authorization>
<deny users="?"/>
</authorization>
2.不断重定向的问题
网上的几种解决方案都试了,包括启用会话、修改源代码,发现还不好使。
在cas server端发现如下日志
<Proxy policy for service [^http://localhost:49753.*] cannot authorize the requested callback url [http://localhost:49753/?proxyResponse=true].>
google查询到如下的解释:
CAS expects the proxy callback to be https (at least by default). Change client to use https.
解决:
因为本地的客户端和cas的服务器都是开发环境,用的都是http,
在web.config中的casClientConfig的配置项中,删除proxyTicketManager的配置就可以了。