├── README.md
├── cas-client-integration-apps
├── simple-webapp
│ ├── src
│ │ └── main
│ │ │ └── webapp
│ │ │ ├── index.jsp
│ │ │ └── WEB-INF
│ │ │ └── web.xml
│ └── pom.xml
└── pom.xml
├── .gitignore
└── local-cas
├── local-cas-server-webapp
├── src
│ └── main
│ │ ├── webapp
│ │ ├── WEB-INF
│ │ │ ├── unused-spring-configuration
│ │ │ │ ├── ticketRegistry-redis.xml
│ │ │ │ ├── authentication-db.xml
│ │ │ │ ├── ticketRegistry-memcached.xml
│ │ │ │ ├── authentication-ldap-search.xml
│ │ │ │ ├── authentication-ldap-direct-bind.xml
│ │ │ │ ├── ldapConnectionPool.xml
│ │ │ │ ├── authentication-ldap-sAMAccountName.xml
│ │ │ │ └── ticketRegistry-jpa.xml
│ │ │ ├── spring-configuration
│ │ │ │ ├── dataSource.xml
│ │ │ │ ├── warnCookieGenerator.xml
│ │ │ │ ├── ticketGrantingTicketCookieGenerator.xml
│ │ │ │ └── propertyFileConfigurer.xml
│ │ │ ├── database.properties
│ │ │ ├── ldap.properties
│ │ │ ├── view
│ │ │ │ └── jsp
│ │ │ │ │ └── default
│ │ │ │ │ └── ui
│ │ │ │ │ └── includes
│ │ │ │ │ └── bottom.jsp
│ │ │ ├── cas.properties
│ │ │ └── deployerConfigContext.xml
│ │ └── js
│ │ │ ├── ba-debug.min.js
│ │ │ └── jquery-1.11.3.min.js
│ │ └── resources
│ │ └── log4j.xml
└── pom.xml
├── cas-server-integration-redis
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── github
│ └── loafer
│ └── cas
│ └── ticket
│ └── registry
│ └── RedisTicketRegistry.java
└── pom.xml
/README.md:
--------------------------------------------------------------------------------
1 | # local-cas
2 |
3 | 基于Jasig-cas 4.0.4
4 |
--------------------------------------------------------------------------------
/cas-client-integration-apps/simple-webapp/src/main/webapp/index.jsp:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World!
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.ipr
3 | *.iws
4 | .idea/
5 | target/
6 | overlays/
7 | pom.xml.tag
8 | pom.xml.releaseBackup
9 | pom.xml.versionsBackup
10 | pom.xml.next
11 | release.properties
12 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/unused-spring-configuration/ticketRegistry-redis.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
--------------------------------------------------------------------------------
/cas-client-integration-apps/simple-webapp/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 | cas-client-integration-apps
6 | com.github.loafer
7 | 1.0-SNAPSHOT
8 |
9 |
10 | simple-webapp
11 | war
12 |
13 |
14 |
15 | org.jasig.cas.client
16 | cas-client-core
17 |
18 |
19 |
20 | javax.servlet
21 | javax.servlet-api
22 |
23 |
24 |
25 |
26 | simple-webapp
27 |
28 |
29 |
--------------------------------------------------------------------------------
/local-cas/cas-server-integration-redis/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 |
5 |
6 | local-cas
7 | com.github.loafer
8 | 1.0-SNAPSHOT
9 |
10 |
11 |
12 | cas-server-integration-redis
13 | jar
14 |
15 | cas-server-integration-redis
16 | http://maven.apache.org
17 |
18 |
19 | UTF-8
20 |
21 |
22 |
23 |
24 | org.jasig.cas
25 | cas-server-core
26 |
27 |
28 |
29 | redis.clients
30 | jedis
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/js/ba-debug.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * JavaScript Debug - v0.4 - 6/22/2010
3 | * http://benalman.com/projects/javascript-debug-console-log/
4 | *
5 | * Copyright (c) 2010 "Cowboy" Ben Alman
6 | * Dual licensed under the MIT and GPL licenses.
7 | * http://benalman.com/about/license/
8 | *
9 | * With lots of help from Paul Irish!
10 | * http://paulirish.com/
11 | */
12 | window.debug=(function(){var i=this,b=Array.prototype.slice,d=i.console,h={},f,g,m=9,c=["error","warn","info","debug","log"],l="assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace".split(" "),j=l.length,a=[];while(--j>=0){(function(n){h[n]=function(){m!==0&&d&&d[n]&&d[n].apply(d,arguments)}})(l[j])}j=c.length;while(--j>=0){(function(n,o){h[o]=function(){var q=b.call(arguments),p=[o].concat(q);a.push(p);e(p);if(!d||!k(n)){return}d.firebug?d[o].apply(i,q):d[o]?d[o](q):d.log(q)}})(j,c[j])}function e(n){if(f&&(g||!d||!d.log)){f.apply(i,n)}}h.setLevel=function(n){m=typeof n==="number"?n:9};function k(n){return m>0?m>n:c.length+m<=n}h.setCallback=function(){var o=b.call(arguments),n=a.length,p=n;f=o.shift()||null;g=typeof o[0]==="boolean"?o.shift():false;p-=typeof o[0]==="number"?o.shift():n;while(p
2 |
7 |
8 |
24 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/database.properties:
--------------------------------------------------------------------------------
1 | # == Basic database connection pool configuration ==
2 | database.driverClass=com.mysql.jdbc.Driver
3 | database.url=jdbc:mysql://localhost:3306/cas?useUnicode=true&characterEncoding=utf-8
4 | database.user=root
5 | database.password=123
6 | database.pool.minSize=6
7 | database.pool.maxSize=18
8 |
9 | # Maximum amount of time to wait in ms for a connection to become
10 | # available when the pool is exhausted
11 | database.pool.maxWait=10000
12 |
13 | # Amount of time in seconds after which idle connections
14 | # in excess of minimum size are pruned.
15 | database.pool.maxIdleTime=120
16 |
17 | # Number of connections to obtain on pool exhaustion condition.
18 | # The maximum pool size is always respected when acquiring
19 | # new connections.
20 | database.pool.acquireIncrement=6
21 |
22 | # == Connection testing settings ==
23 |
24 | # Period in s at which a health query will be issued on idle
25 | # connections to determine connection liveliness.
26 | database.pool.idleConnectionTestPeriod=30
27 |
28 | # Query executed periodically to test health
29 | database.pool.connectionHealthQuery=select 1
30 |
31 | # == Database recovery settings ==
32 |
33 | # Number of times to retry acquiring a _new_ connection
34 | # when an error is encountered during acquisition.
35 | database.pool.acquireRetryAttempts=5
36 |
37 | # Amount of time in ms to wait between successive aquire retry attempts.
38 | database.pool.acquireRetryDelay=2000
39 |
40 | #database.dialect=org.hibernate.dialect.Oracle10gDialect
41 |
42 | database.dialect=org.hibernate.dialect.MySQL5Dialect
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/unused-spring-configuration/authentication-db.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
20 |
21 |
30 |
31 |
36 |
--------------------------------------------------------------------------------
/cas-client-integration-apps/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | 4.0.0
8 |
9 | com.github.loafer
10 | cas-client-integration-apps
11 | pom
12 | 1.0-SNAPSHOT
13 |
14 | simple-webapp
15 |
16 |
17 |
18 | 3.2.1
19 | 3.1.0
20 | 2.7.2
21 |
22 |
23 |
24 |
25 |
26 | org.jasig.cas.client
27 | cas-client-core
28 | ${cas.client.version}
29 |
30 |
31 |
32 | redis.clients
33 | jedis
34 | ${jedis.version}
35 |
36 |
37 |
38 | javax.servlet
39 | javax.servlet-api
40 | ${servlet.version}
41 | provided
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/spring-configuration/warnCookieGenerator.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
26 |
27 | This Spring Configuration file describes the cookie used to store the WARN parameter so that a user is warned whenever the CAS service
28 | is used. You would modify this if you wanted to change the cookie path or the name.
29 |
30 |
31 |
36 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/spring-configuration/ticketGrantingTicketCookieGenerator.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
26 |
27 | Defines the cookie that stores the TicketGrantingTicket. You most likely should never modify these (especially the "secure" property).
28 | You can change the name if you want to make it harder for people to guess.
29 |
30 |
35 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/ldap.properties:
--------------------------------------------------------------------------------
1 | #========================================
2 | # General properties
3 | #========================================
4 | ldap.url=ldap://192.152.1.20:389
5 |
6 | ldap.domain=sinopec.com
7 |
8 | # LDAP connection timeout in milliseconds
9 | ldap.connectTimeout=3000
10 |
11 | # Whether to use StartTLS (probably needed if not SSL connection)
12 | ldap.useStartTLS=false
13 |
14 | #========================================
15 | # LDAP connection pool configuration
16 | #========================================
17 | ldap.pool.minSize=1
18 | ldap.pool.maxSize=2
19 | ldap.pool.validateOnCheckout=false
20 | ldap.pool.validatePeriodically=true
21 |
22 | # Amount of time in milliseconds to block on pool exhausted condition
23 | # before giving up.
24 | ldap.pool.blockWaitTime=3000
25 |
26 | # Frequency of connection validation in seconds
27 | # Only applies if validatePeriodically=true
28 | ldap.pool.validatePeriod=300
29 |
30 | # Attempt to prune connections every N seconds
31 | ldap.pool.prunePeriod=300
32 |
33 | # Maximum amount of time an idle connection is allowed to be in
34 | # pool before it is liable to be removed/destroyed
35 | ldap.pool.idleTime=600
36 |
37 | #========================================
38 | # Authentication
39 | #========================================
40 |
41 | # Base DN of users to be authenticated
42 | #ldap.authn.baseDn=ou=Users,dc=example,dc=org
43 | ldap.authn.baseDn=OU=\u7EC4\u7EC7\u673A\u6784,DC=sinopec,DC=AD
44 |
45 | # Manager DN for authenticated searches
46 | #ldap.authn.managerDN=uid=manager,ou=Users,dc=example,dc=org
47 | ldap.authn.managerDN=username
48 |
49 | # Manager password for authenticated searches
50 | ldap.authn.managerPassword=password
51 |
52 | # Search filter used for configurations that require searching for DNs
53 | #ldap.authn.searchFilter=(&(uid={user})(accountState=active))
54 | ldap.authn.searchFilter=(uid={user})
55 |
56 | # Search filter used for configurations that require searching for DNs
57 | #ldap.authn.format=uid=%s,ou=Users,dc=example,dc=org
58 | ldap.authn.format=uid=%s
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/unused-spring-configuration/ticketRegistry-memcached.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
19 |
20 |
21 |
23 |
24 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
42 |
43 |
45 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/spring-configuration/propertyFileConfigurer.xml:
--------------------------------------------------------------------------------
1 |
2 |
22 |
25 |
26 | This file lets CAS know where you've stored the cas.properties file which details some of the configuration options
27 | that are specific to your environment. You can specify the location of the file here. You may wish to place the file outside
28 | of the Servlet context if you have options that are specific to a tier (i.e. test vs. production) so that the WAR file
29 | can be moved between tiers without modification.
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | /WEB-INF/cas.properties
38 | /WEB-INF/ldap.properties
39 | /WEB-INF/database.properties
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/local-cas/local-cas-server-webapp/src/main/webapp/WEB-INF/view/jsp/default/ui/includes/bottom.jsp:
--------------------------------------------------------------------------------
1 | <%--
2 |
3 | Licensed to Jasig under one or more contributor license
4 | agreements. See the NOTICE file distributed with this work
5 | for additional information regarding copyright ownership.
6 | Jasig licenses this file to you under the Apache License,
7 | Version 2.0 (the "License"); you may not use this file
8 | except in compliance with the License. You may obtain a
9 | copy of the License at the following location:
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing,
14 | software distributed under the License is distributed on an
15 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 | KIND, either express or implied. See the License for the
17 | specific language governing permissions and limitations
18 | under the License.
19 |
20 | --%>
21 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | <%--
38 | JavaScript Debug: A simple wrapper for console.log
39 | See this link for more info: http://benalman.com/projects/javascript-debug-console-log/
40 |
41 |
42 | --%>
43 | ">
44 |
45 |
46 | ">
47 |