CASify an AngularJS web application

Skip to first unread message

india.jai

unread,
May 23, 2016, 9:57:28 AM5/23/16
to CAS Community
Hi All

Is it possible to CASify an AngularJS web application ?

We are planing to refactor our existing CAS web applications and thinking of using AngularJS.

Not able to find a solid answer if its possible or not ?

Can you please kindly clarify ?

Thanks
Jay

Zhou, Yan

unread,
May 23, 2016, 1:05:08 PM5/23/16
to india.jai, CAS Community

We have successfully done that. Our CAS login page show both Angular material look-and-feel and traditional HTML look-and-feel based on the theme.

However, if you are switching CAS front-end to Angular JS, keep in mind that you won't get much benefit from Angular JS, as CAS UI is primarily a server side Spring Web Flow + JSP technology.

The reason we had to support Angular Material is because one of the apps. has an Angular Material look-and-feel, so the login page has to match that style.

Yan

--
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/2b64dab7-32c0-4aa8-a765-a45411994f85%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Neil Sabol

unread,
May 24, 2016, 11:22:36 AM5/24/16
to india.jai, CAS Community

Hi Jay,

 

Good question – we struggled with this a little while ago and devised a solution that worked for our Angular JS applications. This may or may not scale or apply to your situation.

 

We discovered that mod_auth_cas “sees” routes in Angular (based on URI anyway). We configured mod_auth_cas to trigger when specific URIs are accessed in our Angular application and use those URIs POST to a “login.php” file that simply returns the UID of the currently authenticated user(basically, just echoing $SERVER[‘REMOTE_USER’]) to the Angular app. The “login.php” file must also be included in the paths that mod_auth_cas triggers for.

 

There is definitely room for improvement. We hoped to use phpCAS but it did not play well in our Angular app (CORS issues).

 

We were also unable to locate a great example, so if you (or anyone else) figure something out, I would be very interested to learn about your approach.

 

I hope this helps.

 

Thanks,

-Neil

--

Julien Gribonvald

unread,
May 25, 2016, 3:13:31 AM5/25/16
to cas-...@apereo.org
Hi,

I suggest that you look at these examples :
with java backend : https://github.com/jgribonvald/demo-spring-cas-angular
with php backend : https://github.com/prigaux/angular-seed

The problem with mod_auth_cas is that it doesn't take care of cas request logout ;)

Thanks
-Julien


--
Julien Gribonvald

Neil Sabol

unread,
May 25, 2016, 11:50:28 AM5/25/16
to julien.g...@recia.fr, cas-...@apereo.org

This is great, thank you Julien!

 

We will look at angular-seed.

 

Our workaround for mod_auth_cas logout is removing the mod_auth_cas cookie and redirecting to the CAS logout page (in our application’s logout handler). Definitely not ideal but it appears to work – I’m hoping we can leverage something more robust like angular-seed+phpCAS going forward.

 

Thank you again,

-Neil

Reply all
Reply to author
Forward
0 new messages