Custom casLoginView - problem calculating URLs

33 views
Skip to first unread message

Pedro Rosas

unread,
Aug 20, 2019, 11:58:36 AM8/20/19
to CAS Community
Hi all,

I'm facing a weird issue on the URL calculation.
I get different outputs for the same inputs...

On my custom "casLoginView.html" I have the following image:

<img th:src="@{/themes/xpto/images/image.svg}"></img>


On runtime this is replaced by:

<img src="/prefix/themes/xpto/images/image.svg" />   -- This path doesn't exist... The correct one should be "/prefix/cas-overlay/themes/...."

---------

But... On my custom "layout.html" I also have an image:

<img th:src="@{/themes/xpto/images/logo.svg}"></img>

But this one gets replaced by:

<img src="/prefix//cas-overly/themes/xpto/images/logo.svg" />   -- The double '//' is a bad thing... but this version works correctly and gets the correct prefix "/prefix/cas-overlay/themes/...."

-----

Do you guys have any idea why the URL replacement logic is different?
Why is the first one missing the "/cas-overlay" prefix?


Thanks in advance.
Best Regards,
  Pedro Rosas

Pedro Rosas

unread,
Aug 20, 2019, 11:59:54 AM8/20/19
to CAS Community
By the way, I'm using CAS 5.3.5.

David Curry

unread,
Aug 20, 2019, 12:11:14 PM8/20/19
to cas-...@apereo.org
It's been a while since I messed with this stuff, but did you remember to update your custom casLoginView.html to use your custom layout.html by changing the layout:decorate attribute of the html tag from ~{layout} to ~{cas-overlay/layout}?

--

DAVID A. CURRY, CISSP
DIRECTOR • INFORMATION SECURITY & PRIVACY
THE NEW SCHOOL  INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 646 909-4728david...@newschool.edu



--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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 view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/189e87ae-f5cf-4fa5-a0c5-8aed4fb49e4a%40apereo.org.

Pedro Rosas

unread,
Aug 20, 2019, 12:37:07 PM8/20/19
to CAS Community
Hi David,

Changing it to ~{cas-overlay/layout} makes it return a 500 internal error: 

Error resolving template "cas-overlay/layout", template might not exist or might not be accessible by any of the configured Template Resolvers.


Could this be related to the cas.server.name and cas.server.prefix properties?
I tried several combinations on this, but none were successful.

I still did not understand the role of these 2 properties...

Thanks.
  Pedro Rosas
To unsubscribe from this group and stop receiving emails from it, send an email to cas-...@apereo.org.

David Curry

unread,
Aug 20, 2019, 1:17:26 PM8/20/19
to cas-...@apereo.org
The cas.server.name and cas.server.prefix shouldn't matter for this. Basically cas.server.name is the URL of your server, and cas.server.prefix includes that plus the application prefix in the J2EE container. Like this:

cas.server.name:     https://casserver.yourdomain.com
cas.server.prefix:   ${cas.server.name}/cas 

cas.server.name can include ports or whatever, like:


As for customizing the UI, you might find this helpful:


That's the "top" page... see the menu on the left of the page for the following sections. It's written for 5.2.x, but should be pretty much the same for 5.3.x.

--Dave

--

DAVID A. CURRY, CISSP
DIRECTOR • INFORMATION SECURITY & PRIVACY
THE NEW SCHOOL  INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 646 909-4728david...@newschool.edu


To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/35fa2509-2bfd-4a19-ac32-f547bf432b5b%40apereo.org.
Reply all
Reply to author
Forward
0 new messages