diff --git a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredAppApplication.java b/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredAppApplication.java index fc05e3b38f..25cbb9bc9b 100644 --- a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredAppApplication.java +++ b/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredAppApplication.java @@ -40,14 +40,14 @@ public class CasSecuredAppApplication { @Primary public AuthenticationEntryPoint authenticationEntryPoint(ServiceProperties sP) { CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint(); - entryPoint.setLoginUrl("https://localhost:8443/cas/login"); + entryPoint.setLoginUrl("https://localhost:6443/cas/login"); entryPoint.setServiceProperties(sP); return entryPoint; } @Bean public TicketValidator ticketValidator() { - return new Cas30ServiceTicketValidator("https://localhost:8443/cas"); + return new Cas30ServiceTicketValidator("https://localhost:6443/cas"); } @Bean @@ -71,7 +71,7 @@ public class CasSecuredAppApplication { @Bean public LogoutFilter logoutFilter() { LogoutFilter logoutFilter = new LogoutFilter( - "https://localhost:8443/cas/logout", securityContextLogoutHandler()); + "https://localhost:6443/cas/logout", securityContextLogoutHandler()); logoutFilter.setFilterProcessesUrl("/logout/cas"); return logoutFilter; } @@ -79,7 +79,7 @@ public class CasSecuredAppApplication { @Bean public SingleSignOutFilter singleSignOutFilter() { SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter(); - singleSignOutFilter.setCasServerUrlPrefix("https://localhost:8443/cas"); + singleSignOutFilter.setCasServerUrlPrefix("https://localhost:6443/cas"); singleSignOutFilter.setIgnoreInitConfiguration(true); return singleSignOutFilter; } diff --git a/cas/cas-server/etc/cas/thekeystore b/cas/cas-server/etc/cas/thekeystore deleted file mode 100644 index 15f9af2dae..0000000000 Binary files a/cas/cas-server/etc/cas/thekeystore and /dev/null differ diff --git a/cas/cas-server/etc/cas/thekeystore.crt b/cas/cas-server/etc/cas/thekeystore.crt deleted file mode 100644 index 5c7543f0c6..0000000000 Binary files a/cas/cas-server/etc/cas/thekeystore.crt and /dev/null differ diff --git a/cas/cas-server/src/main/resources/application.properties b/cas/cas-server/src/main/resources/application.properties index 2d5e9a7277..afacd4cbc1 100644 --- a/cas/cas-server/src/main/resources/application.properties +++ b/cas/cas-server/src/main/resources/application.properties @@ -2,9 +2,9 @@ # CAS Server Context Configuration # server.context-path=/cas -server.port=8443 +server.port=6443 -server.ssl.key-store=file:/etc/cas/thekeystore +server.ssl.key-store=classpath:/etc/cas/thekeystore server.ssl.key-store-password=changeit server.ssl.key-password=changeit # server.ssl.ciphers= @@ -40,6 +40,12 @@ spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true spring.http.encoding.force=true +## +#CAS CONFIG LOCATION +# +cas.standalone.config=classpath:/etc/cas/config + + ## # CAS Cloud Bus Configuration # @@ -82,6 +88,7 @@ spring.thymeleaf.mode=HTML # CAS Log4j Configuration # # logging.config=file:/etc/cas/log4j2.xml + server.context-parameters.isLog4jAutoInitializationDisabled=true ## @@ -104,9 +111,10 @@ cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.MySQLDialect cas.authn.jdbc.query[0].user=root cas.authn.jdbc.query[0].password= cas.authn.jdbc.query[0].ddlAuto=none -cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver +#cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver +cas.authn.jdbc.query[0].driverClass=com.mysql.cj.jdbc.Driver cas.authn.jdbc.query[0].fieldPassword=password -cas.authn.jdbc.query[0].passwordEncoder.type=BCRYPT +cas.authn.jdbc.query[0].passwordEncoder.type=NONE ## diff --git a/cas/cas-server/src/main/resources/cas.properties b/cas/cas-server/src/main/resources/cas.properties index be2babcd14..f80f22fc11 100644 --- a/cas/cas-server/src/main/resources/cas.properties +++ b/cas/cas-server/src/main/resources/cas.properties @@ -1,16 +1,15 @@ -cas.server.name: https://localhost:8443 -cas.server.prefix: https://localhost:8443/cas +cas.server.name: https://localhost:6443 +cas.server.prefix: https://localhost:643/cas cas.adminPagesSecurity.ip=127\.0\.0\.1 -logging.config: file:/etc/cas/config/log4j2.xml - cas.serviceRegistry.initFromJson=true cas.serviceRegistry.config.location=classpath:/services cas.authn.accept.users= cas.authn.accept.name= + #CAS Database Authentication Property # cas.authn.jdbc.query[0].healthQuery= diff --git a/cas/cas-server/src/main/resources/etc/cas/config/application.yml b/cas/cas-server/src/main/resources/etc/cas/config/application.yml new file mode 100644 index 0000000000..be1f7c3edd --- /dev/null +++ b/cas/cas-server/src/main/resources/etc/cas/config/application.yml @@ -0,0 +1,2 @@ +info: + description: CAS Configuration \ No newline at end of file diff --git a/cas/cas-server/src/main/resources/etc/cas/config/cas.properties b/cas/cas-server/src/main/resources/etc/cas/config/cas.properties new file mode 100644 index 0000000000..47a1477308 --- /dev/null +++ b/cas/cas-server/src/main/resources/etc/cas/config/cas.properties @@ -0,0 +1,7 @@ +cas.server.name: https://cas.example.org:8443 +cas.server.prefix: https://cas.example.org:8443/cas + +cas.adminPagesSecurity.ip=127\.0\.0\.1 + +logging.config: file:/etc/cas/config/log4j2.xml +# cas.serviceRegistry.config.location: classpath:/services diff --git a/cas/cas-server/src/main/resources/etc/cas/config/log4j2.xml b/cas/cas-server/src/main/resources/etc/cas/config/log4j2.xml new file mode 100644 index 0000000000..53b30b4228 --- /dev/null +++ b/cas/cas-server/src/main/resources/etc/cas/config/log4j2.xml @@ -0,0 +1,117 @@ + + + + + + . + + warn + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cas/cas-server/src/main/resources/etc/cas/thekeystore b/cas/cas-server/src/main/resources/etc/cas/thekeystore new file mode 100644 index 0000000000..86170dff16 Binary files /dev/null and b/cas/cas-server/src/main/resources/etc/cas/thekeystore differ diff --git a/cas/cas-server/src/main/resources/etc/cas/thekeystore.crt b/cas/cas-server/src/main/resources/etc/cas/thekeystore.crt new file mode 100644 index 0000000000..5bd9d5baba Binary files /dev/null and b/cas/cas-server/src/main/resources/etc/cas/thekeystore.crt differ