Closed fvanderbiest closed 2 years ago
I'd like to go further, like customizing the "login again after logout" link, which currently leads to /cas/login
while /?login
would be expected instead. Leaving this to whoever knows how to do it (no time to dig for now).
Hum, I had a look at this, but couldn't figure it out. Can't even see the modifications to the logout page applied (like deleting the security phrase). I think login
and logout
folders should go into georchestra
folder/theme. But even moving them doesn't help. Does this work on your side?
Two other questions:
casGenericSuccessView.html
in the browser?message_properties_*
files?I think
login
andlogout
folders should go intogeorchestra
folder/theme
right, my bad. untested ...
- Is there a way I can access the
casGenericSuccessView.html
in the browser?
Yes, by accessing directly /cas/login and authenticating.
- Why did you add the
message_properties_*
files?
Because I wanted to remove a weird sentence like "please have a look at this ugly array" (in the above case)
- Is there a way I can access the
casGenericSuccessView.html
in the browser?Yes, by accessing directly /cas/login and authenticating.
Yes, once it's deployed, but I couldn't get to the view within this repo to test:-(
Tobias, would you be able to take over this PR and make the obvious changes (eg: relocating the files) ? Would be awesome. To check everything works as expected, you can use the docker image from this PR and check locally using a reduced version of the official docker composition (https://github.com/georchestra/docker) with only cas, sp, traefik, header, ldap, postgres.
Yep, I'll have a look at this again later and try to get it working.
Added two commits, but still can't get the modifications displayed :-(
Added two commits, but still can't get the modifications displayed :-(
@pmauduit to the rescue ?
After having live-debugged a bit (as it does not seem to be documented out there, or the doc is not quite clear on where the templates should be copied), I stumbled upon the following class: https://github.com/apereo/cas/blob/master/support/cas-server-support-thymeleaf/src/main/java/org/apereo/cas/web/view/ThemeClassLoaderTemplateResolver.java#L40
And figured out that the expected template locations were not correct (maybe because in a other versions of CAS, they have been moved ?):
src/main/resources/templates/georchestra/casLogoutView.html
src/main/resources/emplates/georchestra/casGenericSuccessView.html
the above class is already responsible of figuring out which template to use given the default configured theme.
After setting the file in the expected location, I get the following 500 though:
org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing org.springframework.webflow.action.ViewFactoryActionAdapter@68424ada in state 'logoutView' of flow 'logout' -- action execution attributes were 'map[[empty]]'
at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:62)
[...]
Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template [georchestra/layout], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "georchestra/casLogoutView" - line 2, col 64)
Which means:
FYI just creating an empty layout.html file fixes the issue (and I can see your "blablu" paragraph from https://github.com/georchestra/georchestra-cas-server/pull/6/files#diff-51133fe5ec56488f0f51d370a20609e57d874d4abd62f0d0b1f3f2849e087645R24 ;-))
Excellent, thanks Pierre !
Ah, thanks @pmauduit for the rescue! This should "unblock" me :-)
Ok, so I moved casLogoutView.html
and casGenericSuccessView.html
accordingly and added layout.html
and includes.html
which were necessary to make the templates work.
In the casLogoutView.html
the modifications are getting applied now, casGenericSuccessView.html
remains untested, as I could not connect via CAS 6 within the georchestra docker compo. Tried to adapt the datadir accordingly, but without success. @pmauduit could you have a look at this?
@pmauduit could you have a look at this?
Checking the current state of your branch, there is still something wrong in the template:
Here is the stacktrace I obtained:
Caused by: org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/georchestra/casGenericSuccessView.html]")
[...]
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "service.serviceId" (template: "georchestra/casGenericSuccessView" - line 136, col 61)
[...]
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'serviceId' cannot be found on null
@tkohr I think you should remove the commented out portions of the file (that's what git is about anyway, and since thymeleaf will still process commented html code, it still can fail).
@tkohr I pushed another commit to get closer to what you wanted to do, does it look ok to you ?
Here is the result at runtime btw:
Checking the casLogout template again, and I think we should be good to go
Ok, seems working:
Hiding scary stuff for "normal humans" like this array: