Is there any way to completely rebuild cas login view?

79 views
Skip to first unread message

James Mackerel

unread,
May 15, 2019, 12:34:48 PM5/15/19
to CAS Community
Hello everyone,

I am trying to find a way to completely customize CAS login view. We have some complex view customization work to do, for example, let users to login via scanning QR code, etc.

After searching, I found this:

https://apereo.github.io/2018/06/10/cas-userinterface-customizations/#restful-views

But when I search for "cas.view.rest.url" in google, it told me there is only one result web, which is the web page mentioned above.

We tried to customize by overriding templates/loginView.html but it was really hard work.

In fact, I have had an idea in my mind. I saw CAS REST Protocol the other day and I thought I could build a completely new single page application on these RESTful APIs, but I will have to implement CAS Protocol on this SPA myself in that way, which is ugly and insecure.

I wonder if there is a elegant way to customize login view? Many thanks to you.

Ray Bon

unread,
May 15, 2019, 1:54:15 PM5/15/19
to cas-...@apereo.org
James,

If you want to change the look of the login page there is https://apereo.github.io/cas/6.0.x/ux/User-Interface-Customization.html#

If you want to add a new authentication mechanism then you will have to modify web flow, https://apereo.github.io/cas/6.0.x/webflow/Webflow-Customization.html and add the appropriate code to perform the authentication process, https://apereo.github.io/cas/6.0.x/installation/Configuring-Custom-Authentication.html.

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

Andy Ng

unread,
May 15, 2019, 9:43:01 PM5/15/19
to CAS Community
Dear James,


> I am trying to find a way to completely customize CAS login view
Do you mean customize the layout (i.e. HTML, css, javascript), or do you mean customize the login logic (i.e. login using Database / LDAP / other mechamism...)?

If you want to customize layout:
- try this: https://groups.google.com/a/apereo.org/d/msg/cas-user/k-yfoou7Zy0/r6ydWfdNDwAJ

If you want to customize login logic:
- You can either follow Ray advice so use  https://apereo.github.io/cas/6.0.x/installation/Configuring-Custom-Authentication.html.

- Or.. You can try delegate authentication from your CAS to your other webpage https://apereo.github.io/cas/6.0.x/integration/Delegate-Authentication.html
- So user can click on a button on your CAS to redirect from CAS to your QR code scanning webpage
- After done, you send back some attribute to CAS via OAuth / SAML / other protocol, so CAS can login appropriately


Would not recommend using CAS Rest authentication for your purpose, I have use CAS rest protocol before and that doesn't seems to do what you want.

Cheers!
- Andy






Jeff Sittler

unread,
Jun 12, 2019, 12:53:42 AM6/12/19
to CAS Community
Were you able to find a solution to customizing the login view?

-Jeff

jm

unread,
Aug 21, 2019, 2:39:54 AM8/21/19
to CAS Community
Yes, but in an ugly way. Just put templates folder in your customized cas-overlay project directory, and make your changes on templates. overlay will package your folder and use your customized view.

If you want to modify login logic, then you may have to change webflow configuration, I am not expert of it, you are on your own.

在 2019年6月12日星期三 UTC+8下午12:53:42,Jeff Sittler写道:
Reply all
Reply to author
Forward
0 new messages