I'm trying to find the correct way to include CAS into Magento. The way I currently have it set up is by including the required files in the index.php file. This works until I turn FPC caching on in Magento then I run into the problem where the first time I login it works but if the next person logs in they are thrown into a redirect loop.
Clearing the cache fixes it for the first person but then the next person runs into the loop issue. It seems to be Magento is caching the ticket it should be receiving so it works the first time but not after.
I don't even know where to being to bust the cache for this.
EDIT: Figured out how to autoload correctly. Still can't figure out why CAS is being cached. I'm initing CAS in the observer by doing
phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context).
Looking at the headers I see that CAS is returning with a ticket set but when Magento goes to validate it isn't providing the correct ticket which cause it to go get another and loop.
Final edit: CAS' class wasn't being instantiated correctly. This is resolved with just the library being included correctly.