Integrating CAS Proxying with Forms Authentication in ASP.Net 2.0
To set up CAS authentication in ASP.Net is a relatively simple process if you don't implement Forms Authentication and do NOT require your application to act as a CAS proxy.
The .Net assembly (DLL) and source code needed for this article can be downloaded here. Just drop it in your project's bin folder.
For an example of how to do CAS proxying with classic ASP, see me other article CAS Proxying with Classic ASP
First drop the CASAuthentication.dll (attached) into your project's bin folder. Then, In Web.config, make the following changes:
The CAS proxier - (Your main default page)
The CAS callback Url (This would be the same application page specified in the pgtUrl attribute in the call to InvokeCASProxy method shown above) - This assumes that your main application (the CAS proxier) and callback Url are part of the same application so that they can share application specific variables. If the callback Url is NOT part of the same application, then you must handle storing/retrieving the pgtIou/pgtId pair yourself. (e.g. store them in an external database).
Because your callback Url will be called by CAS directly, you must turn off Forms Authentication for this page. This is easily achieved by adding the following to your web.config file root configuration section:
The CAS Proxy (This would be the same application specified in the ProxyAppUrl attribute in the call to InvokeCASProxy method shown above)