|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| package org.acegisecurity.providers.cas.ticketvalidator; |
|
17 |
| |
|
18 |
| import org.acegisecurity.providers.cas.TicketValidator; |
|
19 |
| import org.acegisecurity.ui.cas.ServiceProperties; |
|
20 |
| |
|
21 |
| import org.apache.commons.logging.Log; |
|
22 |
| import org.apache.commons.logging.LogFactory; |
|
23 |
| import org.springframework.beans.factory.InitializingBean; |
|
24 |
| import org.springframework.util.Assert; |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| public abstract class AbstractTicketValidator implements TicketValidator, |
|
34 |
| InitializingBean { |
|
35 |
| |
|
36 |
| |
|
37 |
| private static final Log logger = LogFactory.getLog(CasProxyTicketValidator.class); |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| private ServiceProperties serviceProperties; |
|
42 |
| private String casValidate; |
|
43 |
| private String trustStore; |
|
44 |
| |
|
45 |
| |
|
46 |
| |
|
47 |
6
| public void setCasValidate(String casValidate) {
|
|
48 |
6
| this.casValidate = casValidate;
|
|
49 |
| } |
|
50 |
| |
|
51 |
| |
|
52 |
| |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
5
| public String getCasValidate() {
|
|
62 |
5
| return casValidate;
|
|
63 |
| } |
|
64 |
| |
|
65 |
6
| public void setServiceProperties(ServiceProperties serviceProperties) {
|
|
66 |
6
| this.serviceProperties = serviceProperties;
|
|
67 |
| } |
|
68 |
| |
|
69 |
8
| public ServiceProperties getServiceProperties() {
|
|
70 |
8
| return serviceProperties;
|
|
71 |
| } |
|
72 |
| |
|
73 |
2
| public void setTrustStore(String trustStore) {
|
|
74 |
2
| this.trustStore = trustStore;
|
|
75 |
| } |
|
76 |
| |
|
77 |
| |
|
78 |
| |
|
79 |
| |
|
80 |
| |
|
81 |
| |
|
82 |
| |
|
83 |
| |
|
84 |
| |
|
85 |
2
| public String getTrustStore() {
|
|
86 |
2
| return trustStore;
|
|
87 |
| } |
|
88 |
| |
|
89 |
4
| public void afterPropertiesSet() throws Exception {
|
|
90 |
4
| Assert.hasLength(casValidate, "A casValidate URL must be set");
|
|
91 |
3
| Assert.notNull(serviceProperties, "serviceProperties must be specified");
|
|
92 |
| |
|
93 |
2
| if ((trustStore != null) && (!"".equals(trustStore))) {
|
|
94 |
1
| if (logger.isDebugEnabled()) {
|
|
95 |
0
| logger.debug("Setting system property 'javax.net.ssl.trustStore'" +
|
|
96 |
| " to value [" + trustStore + "]"); |
|
97 |
| } |
|
98 |
1
| System.setProperty("javax.net.ssl.trustStore", trustStore);
|
|
99 |
| } |
|
100 |
| } |
|
101 |
| } |