As already mentioned CAS is a web SSO, so you need to pass through it's own authentication page in order to get the SSO working. There are many ways to get CAS working with your authentication persistent system (in my projects I usually use JPA as my customers have many old applications based only on relational db persistence). In your project I suppose you can setup CAS to use your application authentication method, while your application can point directly to CAS for authentication itself. What I mean is that your application as well should use CAS for single sign on, so the users can enter their credentials just once. Finally you can customize CAS theme in order to get login and error pages with the same layout as your application (you can even load CAS login page in an iframe and then reload your application page on success if you want to integrate it inside your webapp).
If I understood what you wrote you want it to behave this way:
- you login in your application
- your application tells CAS you logged in
- you access another application
- the other application asks CAS if the user is logged in and CAS answers yes
But the "easy" explanation of the workflow is:
- you try to access a secured part of any application secured with CAS (your or another)
- the application asks CAS if the user is logged
- CAS answers no, so the user is redirected to CAS login
- the user authenticates with CAS
- CAS redirects the user to the calling application
- the application asks CAS if the user is logged in and CAS answers yes
- the user can access secured parts of the application
- the user try to access another application
- the "another" application asks CAS if the user is logged in and CAS answers yes
- the user can access secured parts of the "another" application