CAS (Central Authentication Service) is an open source project which was sponsored by Yale and it is an enterprise Single Sign-On solution for web services. The .NET CAS client provides CAS integration for the Microsoft Windows platform via the .NET framework and integrates with ASP.NET applications by customizing the application web.config file. It is convenient for us to deploy SSO with your ASP.NET applications.
However, when I applied dotnet-client-1.0.2 on my project, I had encountered lots of issues. Most of the common issues I can solved by searching internet except one issue which was unexpected redirection. It returns exception with message too many redirections, but it only occurs in IE browser, not Firefox or Chrome.
This issue took me a lot of time, I had searched all possible blogs and related forums on internet, but still no solution. Finally, I downloaded the source code and debug it on my project, I tracked the data and find out the root cause. When .NET Client sends a request to CAS server, CAS Server will return a ticket and the cookie .ASPXAUTH was added in IE browser, but the key problem is when .NET Client request to login CAS Server with .ASPXAUTH, the cookie .ASPXAUTH was lost, it was empty, below are solution to fix this issue:
Step1: Find the .NET CAS Client source code, go to CasAuthentication.cs file.
Step2: go to line 1070, find the following code.
Step3: replace code above with following code block and rebuild a new DotNetCasClient.dll.
Step4: re-test, the cookie .ASPXAUTH won’t be empty any more, and login CAS server successfully.