why is redirecting to cas.example.org:8443 instead of using cas.server.name host

404 views
Skip to first unread message

figurefigure mix

unread,
Dec 27, 2023, 4:04:43 AM12/27/23
to CAS Community
<dependencies>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-mgmt-webapp-tomcat</artifactId>
<version>${mgmt.version}</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
</dependencies>

once i run it with `java -jar cas-management.jar --spring.profiles.active=management` and I open it url `localhost:8443/cas-management` it redirect me on `https://cas.example.org:8443/cas/login`

why is this happening instead of redirecting me on the referenced cas server I've declered under application-management.properties the following properties

cas.server.name=http://localhost:8443
cas.server.prefix=${cas.server.name}/cas
server.servlet.context-path=/cas-management
server.port=8443

the file properties work properly because when i change the server port also tomcat port change with it

figurefigure mix

unread,
Dec 28, 2023, 9:50:58 AM12/28/23
to CAS Community, figurefigure mix
logs below
```bash
2023-12-28 09:14:21,578 DEBUG [org.apereo.cas.support.saml.DefaultOpenSamlConfigBean] - <Initialized OpenSaml successfully.>
2023-12-28 09:14:21,623 INFO [org.apereo.cas.util.io.PathWatcherService] - <Watching directory path at [/opt/casmanagement/conf]>
2023-12-28 09:14:21,625 DEBUG [org.apereo.cas.mgmt.config.CasManagementAuthenticationConfiguration] - <Configuring an authentication strategy based on CAS running at [https://cas.example.org:8443]>
2023-12-28 09:14:21,639 DEBUG [org.apereo.cas.mgmt.config.CasManagementAuthenticationConfiguration] - <Skipping IP address authentication strategy configuration; no pattern is defined>
2023-12-28 09:14:21,665 INFO [org.apereo.cas.mgmt.factory.FormDataFactory] - <Call to cas/actuator/discoveryProfile disabled by management configuration.  Using default FormData values.>
2023-12-28 09:14:21,728 DEBUG [org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry] - <Attempting to read and parse [/tmp/cas/HTTPSandIMAPS-10000001.json]>
2023-12-28 09:14:21,729 DEBUG [org.apereo.cas.services.resource.AbstractResourceBasedServiceRegistry] - <Attempting to read and parse [/tmp/cas/Apereo-10000002.json]>
2023-12-28 09:14:21,817 WARN [org.pac4j.core.matching.matcher.PathMatcher] - <Be careful when using the 'excludeBranch' or 'excludeRegex' methods. They use regular expressions and their definitions may be error prone. You could exclude more URLs than expected.>
2023-12-28 09:14:21,862 WARN [org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration] - <
```

Mohamed Amdouni

unread,
Feb 7, 2024, 11:43:30 AM2/7/24
to CAS Community, figurefigure mix
Hello,

I have the same problem with CAS management.

Even with management.properties updated with cas server.

In the log file I see that it loads an application.properties/ management.properties and bootstrap.properties from the classpath, containing properties with heroku. adress etc

I don't know from where it generates this file when building from overlay project... I have only an empty application.yml in the project sources.

I'm using an extrenal application.properties referenced by spring.config.location

My questions are :

- where to find the property with cas.example.org?
- how to avoid adding application.properties when building the project?
- Does the laste version of cas-management (6.4) requires to add a FilterChain bean because in the log it is using the default FilterChain with Ant pattern = '/**' -> 
messsage from log : "Will secure Ant (pattern='/**')" 


Thank you

Ray Bon

unread,
Feb 7, 2024, 1:09:28 PM2/7/24
to cas-...@apereo.org, mixfigu...@gmail.com
Mohamed,

In my cas-management 6.5, I have this in management.properties which I place in /etc/cas/config
cas.server.name=https://${cas.server.scope}
cas.server.prefix=${cas.server.name}/cas

logging.config: file:/etc/cas/config/log4j2-management.xml

mgmt.server-name=${cas.server.name}

where cas.server.scope=local.uvic.ca

The default files and their properties come from the main project.

Ray

On Wed, 2024-02-07 at 08:28 -0800, Mohamed Amdouni wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Mohamed Amdouni

unread,
Feb 7, 2024, 1:16:30 PM2/7/24
to cas-...@apereo.org, mixfigu...@gmail.com
You mean 6.4? The only version available in 
https://getcas.apereo.org/ui when choosing cas management is 6.4

Will try the cas.server.scope 

Thanks 

--
- 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/439cfe35ffc0df3342a07565e83b64b4b6336a2e.camel%40uvic.ca.

Mohamed Amdouni

unread,
Feb 9, 2024, 10:52:50 AM2/9/24
to cas-...@apereo.org, mixfigu...@gmail.com
Hi Ray,

Would it be possible to share with me your build.gradke the dependencies section.

I think that I miss the dependency that contains the definition of the security filter chain.

Best regards.

Ray Bon

unread,
Feb 9, 2024, 12:21:37 PM2/9/24
to cas-...@apereo.org, mixfigu...@gmail.com
Mohamed,

The only change I made to build.gradle was add the ldap repository dependency. You do not need to adjust the security filter chain.

The version in getcas... is 6.6.4
Is this the version you are using?

Sorry, I forgot to say that management.properties is in etc/cas/config/
It is a basic file to run when no dependencies are selected.
You can edit this file and the build process will [try to] place it in /etc/cas/config - cas management will look for it there by default.
You can also copy this file to a directory of your choosing and tell cas management to look there with tomcat/jvm startup options or placed in TOMCAT_HOME/bin/setenv.sh
As an example, this is in my setenv

JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS \
--add-modules java.se \
--add-exports java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens java.management/sun.management=ALL-UNNAMED \
--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED"
export JDK_JAVA_OPTS

CATALINA_OPTS="$CATALINA_OPTS -Dspring.config.additional-location=/etc/cas/config/bootstrap.yml,classpath:/application.yml,/etc/cas/config/application.properties,/etc/cas/config/management.properties"
export CATALINA_OPTS

Ray
Reply all
Reply to author
Forward
0 new messages