Refactor Cas-Server Configurations (#2970)
* added updated example codes * updated example code StringToCharStream * deleted StringToCharStream.java locally * removed redundant file * added code for apache commons collection SetUtils * refactored example code * added example code for bytebuddy * added example code for PCollections * update pom * refactored tests for PCollections * spring security xml config * spring security xml config * remove redundant comment * example code for apache-shiro * updated example code for Vavr Collections * updated Vavr's Collection example * updated Vavr Collection file * updated example code for Apache Shiro * updated Vavr Collections example * added example code for N1QL * update example code for N1QL * added integration test for N1QL * update N1QL Example code * update the N1QL example Code * rename module to couchbase * rename module to couchbase * change module name in parent module and pom * added cas-server module * added cas secured app for Spring SSO with CAS * refactor cas modules into cas folder * updated files * removed redundant files * refactor the config for cas-server
This commit is contained in:
parent
93ecfad7fe
commit
50daef5bdc
@ -40,14 +40,14 @@ public class CasSecuredAppApplication {
|
|||||||
@Primary
|
@Primary
|
||||||
public AuthenticationEntryPoint authenticationEntryPoint(ServiceProperties sP) {
|
public AuthenticationEntryPoint authenticationEntryPoint(ServiceProperties sP) {
|
||||||
CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint();
|
CasAuthenticationEntryPoint entryPoint = new CasAuthenticationEntryPoint();
|
||||||
entryPoint.setLoginUrl("https://localhost:8443/cas/login");
|
entryPoint.setLoginUrl("https://localhost:6443/cas/login");
|
||||||
entryPoint.setServiceProperties(sP);
|
entryPoint.setServiceProperties(sP);
|
||||||
return entryPoint;
|
return entryPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public TicketValidator ticketValidator() {
|
public TicketValidator ticketValidator() {
|
||||||
return new Cas30ServiceTicketValidator("https://localhost:8443/cas");
|
return new Cas30ServiceTicketValidator("https://localhost:6443/cas");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ -71,7 +71,7 @@ public class CasSecuredAppApplication {
|
|||||||
@Bean
|
@Bean
|
||||||
public LogoutFilter logoutFilter() {
|
public LogoutFilter logoutFilter() {
|
||||||
LogoutFilter logoutFilter = new LogoutFilter(
|
LogoutFilter logoutFilter = new LogoutFilter(
|
||||||
"https://localhost:8443/cas/logout", securityContextLogoutHandler());
|
"https://localhost:6443/cas/logout", securityContextLogoutHandler());
|
||||||
logoutFilter.setFilterProcessesUrl("/logout/cas");
|
logoutFilter.setFilterProcessesUrl("/logout/cas");
|
||||||
return logoutFilter;
|
return logoutFilter;
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ public class CasSecuredAppApplication {
|
|||||||
@Bean
|
@Bean
|
||||||
public SingleSignOutFilter singleSignOutFilter() {
|
public SingleSignOutFilter singleSignOutFilter() {
|
||||||
SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
|
SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
|
||||||
singleSignOutFilter.setCasServerUrlPrefix("https://localhost:8443/cas");
|
singleSignOutFilter.setCasServerUrlPrefix("https://localhost:6443/cas");
|
||||||
singleSignOutFilter.setIgnoreInitConfiguration(true);
|
singleSignOutFilter.setIgnoreInitConfiguration(true);
|
||||||
return singleSignOutFilter;
|
return singleSignOutFilter;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -2,9 +2,9 @@
|
|||||||
# CAS Server Context Configuration
|
# CAS Server Context Configuration
|
||||||
#
|
#
|
||||||
server.context-path=/cas
|
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-store-password=changeit
|
||||||
server.ssl.key-password=changeit
|
server.ssl.key-password=changeit
|
||||||
# server.ssl.ciphers=
|
# server.ssl.ciphers=
|
||||||
@ -40,6 +40,12 @@ spring.http.encoding.charset=UTF-8
|
|||||||
spring.http.encoding.enabled=true
|
spring.http.encoding.enabled=true
|
||||||
spring.http.encoding.force=true
|
spring.http.encoding.force=true
|
||||||
|
|
||||||
|
##
|
||||||
|
#CAS CONFIG LOCATION
|
||||||
|
#
|
||||||
|
cas.standalone.config=classpath:/etc/cas/config
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# CAS Cloud Bus Configuration
|
# CAS Cloud Bus Configuration
|
||||||
#
|
#
|
||||||
@ -82,6 +88,7 @@ spring.thymeleaf.mode=HTML
|
|||||||
# CAS Log4j Configuration
|
# CAS Log4j Configuration
|
||||||
#
|
#
|
||||||
# logging.config=file:/etc/cas/log4j2.xml
|
# logging.config=file:/etc/cas/log4j2.xml
|
||||||
|
|
||||||
server.context-parameters.isLog4jAutoInitializationDisabled=true
|
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].user=root
|
||||||
cas.authn.jdbc.query[0].password=
|
cas.authn.jdbc.query[0].password=
|
||||||
cas.authn.jdbc.query[0].ddlAuto=none
|
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].fieldPassword=password
|
||||||
cas.authn.jdbc.query[0].passwordEncoder.type=BCRYPT
|
cas.authn.jdbc.query[0].passwordEncoder.type=NONE
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
cas.server.name: https://localhost:8443
|
cas.server.name: https://localhost:6443
|
||||||
cas.server.prefix: https://localhost:8443/cas
|
cas.server.prefix: https://localhost:643/cas
|
||||||
|
|
||||||
cas.adminPagesSecurity.ip=127\.0\.0\.1
|
cas.adminPagesSecurity.ip=127\.0\.0\.1
|
||||||
|
|
||||||
logging.config: file:/etc/cas/config/log4j2.xml
|
|
||||||
|
|
||||||
cas.serviceRegistry.initFromJson=true
|
cas.serviceRegistry.initFromJson=true
|
||||||
cas.serviceRegistry.config.location=classpath:/services
|
cas.serviceRegistry.config.location=classpath:/services
|
||||||
|
|
||||||
cas.authn.accept.users=
|
cas.authn.accept.users=
|
||||||
cas.authn.accept.name=
|
cas.authn.accept.name=
|
||||||
|
|
||||||
|
|
||||||
#CAS Database Authentication Property
|
#CAS Database Authentication Property
|
||||||
|
|
||||||
# cas.authn.jdbc.query[0].healthQuery=
|
# cas.authn.jdbc.query[0].healthQuery=
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
info:
|
||||||
|
description: CAS Configuration
|
@ -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
|
117
cas/cas-server/src/main/resources/etc/cas/config/log4j2.xml
Normal file
117
cas/cas-server/src/main/resources/etc/cas/config/log4j2.xml
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!-- Specify the refresh internal in seconds. -->
|
||||||
|
<Configuration monitorInterval="5" packages="org.apereo.cas.logging">
|
||||||
|
<Properties>
|
||||||
|
<!--
|
||||||
|
Default log directory is the current directory but that can be overridden with -Dcas.log.dir=<logdir>
|
||||||
|
Or you can change this property to a new default
|
||||||
|
-->
|
||||||
|
<Property name="cas.log.dir" >.</Property>
|
||||||
|
<!-- To see more CAS specific logging, adjust this property to info or debug or run server with -Dcas.log.leve=debug -->
|
||||||
|
<Property name="cas.log.level" >warn</Property>
|
||||||
|
</Properties>
|
||||||
|
<Appenders>
|
||||||
|
<Console name="console" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="%d %p [%c] - <%m>%n"/>
|
||||||
|
</Console>
|
||||||
|
<RollingFile name="file" fileName="${sys:cas.log.dir}/cas.log" append="true"
|
||||||
|
filePattern="${sys:cas.log.dir}/cas-%d{yyyy-MM-dd-HH}-%i.log">
|
||||||
|
<PatternLayout pattern="%d %p [%c] - <%m>%n"/>
|
||||||
|
<Policies>
|
||||||
|
<OnStartupTriggeringPolicy />
|
||||||
|
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||||
|
<TimeBasedTriggeringPolicy />
|
||||||
|
</Policies>
|
||||||
|
</RollingFile>
|
||||||
|
<RollingFile name="auditlogfile" fileName="${sys:cas.log.dir}/cas_audit.log" append="true"
|
||||||
|
filePattern="${sys:cas.log.dir}/cas_audit-%d{yyyy-MM-dd-HH}-%i.log">
|
||||||
|
<PatternLayout pattern="%d %p [%c] - %m%n"/>
|
||||||
|
<Policies>
|
||||||
|
<OnStartupTriggeringPolicy />
|
||||||
|
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||||
|
<TimeBasedTriggeringPolicy />
|
||||||
|
</Policies>
|
||||||
|
</RollingFile>
|
||||||
|
|
||||||
|
<RollingFile name="perfFileAppender" fileName="${sys:cas.log.dir}/perfStats.log" append="true"
|
||||||
|
filePattern="${sys:cas.log.dir}/perfStats-%d{yyyy-MM-dd-HH}-%i.log">
|
||||||
|
<PatternLayout pattern="%m%n"/>
|
||||||
|
<Policies>
|
||||||
|
<OnStartupTriggeringPolicy />
|
||||||
|
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||||
|
<TimeBasedTriggeringPolicy />
|
||||||
|
</Policies>
|
||||||
|
</RollingFile>
|
||||||
|
|
||||||
|
<CasAppender name="casAudit">
|
||||||
|
<AppenderRef ref="auditlogfile" />
|
||||||
|
</CasAppender>
|
||||||
|
<CasAppender name="casFile">
|
||||||
|
<AppenderRef ref="file" />
|
||||||
|
</CasAppender>
|
||||||
|
<CasAppender name="casConsole">
|
||||||
|
<AppenderRef ref="console" />
|
||||||
|
</CasAppender>
|
||||||
|
<CasAppender name="casPerf">
|
||||||
|
<AppenderRef ref="perfFileAppender" />
|
||||||
|
</CasAppender>
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<!-- If adding a Logger with level set higher than warn, make category as selective as possible -->
|
||||||
|
<!-- Loggers inherit appenders from Root Logger unless additivity is false -->
|
||||||
|
<AsyncLogger name="org.apereo" level="${sys:cas.log.level}" includeLocation="true"/>
|
||||||
|
<AsyncLogger name="org.apereo.services.persondir" level="${sys:cas.log.level}" includeLocation="true"/>
|
||||||
|
<AsyncLogger name="org.apereo.cas.web.flow" level="info" includeLocation="true"/>
|
||||||
|
<AsyncLogger name="org.apache" level="warn" />
|
||||||
|
<AsyncLogger name="org.apache.http" level="error" />
|
||||||
|
<AsyncLogger name="org.springframework" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.cloud.server" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.cloud.client" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.cloud.bus" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.aop" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.boot" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.boot.actuate.autoconfigure" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.webflow" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.session" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.amqp" level="error" />
|
||||||
|
<AsyncLogger name="org.springframework.integration" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.messaging" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.web" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.orm.jpa" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.scheduling" level="warn" />
|
||||||
|
<AsyncLogger name="org.springframework.context.annotation" level="error" />
|
||||||
|
<AsyncLogger name="org.springframework.boot.devtools" level="error" />
|
||||||
|
<AsyncLogger name="org.springframework.web.socket" level="warn" />
|
||||||
|
<AsyncLogger name="org.thymeleaf" level="warn" />
|
||||||
|
<AsyncLogger name="org.pac4j" level="warn" />
|
||||||
|
<AsyncLogger name="org.opensaml" level="warn"/>
|
||||||
|
<AsyncLogger name="net.sf.ehcache" level="warn" />
|
||||||
|
<AsyncLogger name="com.couchbase" level="warn" includeLocation="true"/>
|
||||||
|
<AsyncLogger name="com.ryantenney.metrics" level="warn" />
|
||||||
|
<AsyncLogger name="net.jradius" level="warn" />
|
||||||
|
<AsyncLogger name="org.openid4java" level="warn" />
|
||||||
|
<AsyncLogger name="org.ldaptive" level="warn" />
|
||||||
|
<AsyncLogger name="com.hazelcast" level="warn" />
|
||||||
|
<AsyncLogger name="org.jasig.spring" level="warn" />
|
||||||
|
|
||||||
|
<!-- Log perf stats only to perfStats.log -->
|
||||||
|
<AsyncLogger name="perfStatsLogger" level="info" additivity="false" includeLocation="true">
|
||||||
|
<AppenderRef ref="casPerf"/>
|
||||||
|
</AsyncLogger>
|
||||||
|
|
||||||
|
<!-- Log audit to all root appenders, and also to audit log (additivity is not false) -->
|
||||||
|
<AsyncLogger name="org.apereo.inspektr.audit.support" level="info" includeLocation="true" >
|
||||||
|
<AppenderRef ref="casAudit"/>
|
||||||
|
</AsyncLogger>
|
||||||
|
|
||||||
|
<!-- All Loggers inherit appenders specified here, unless additivity="false" on the Logger -->
|
||||||
|
<AsyncRoot level="warn">
|
||||||
|
<AppenderRef ref="casFile"/>
|
||||||
|
<!--
|
||||||
|
For deployment to an application server running as service,
|
||||||
|
delete the casConsole appender below
|
||||||
|
-->
|
||||||
|
<AppenderRef ref="casConsole"/>
|
||||||
|
</AsyncRoot>
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
BIN
cas/cas-server/src/main/resources/etc/cas/thekeystore
Normal file
BIN
cas/cas-server/src/main/resources/etc/cas/thekeystore
Normal file
Binary file not shown.
BIN
cas/cas-server/src/main/resources/etc/cas/thekeystore.crt
Normal file
BIN
cas/cas-server/src/main/resources/etc/cas/thekeystore.crt
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user