01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS,
11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: * See the License for the specific language governing permissions and
13: * limitations under the License.
14: */
15:
16: package org.acegisecurity.ui.cas;
17:
18: import org.springframework.beans.factory.InitializingBean;
19:
20: /**
21: * Stores properties related to this CAS service.<P>Each web application capable of processing CAS tickets is known
22: * as a service. This class stores the properties that are relevant to the local CAS service, being the application
23: * that is being secured by the Acegi Security System for Spring.</p>
24: *
25: * @author Ben Alex
26: * @version $Id: ServiceProperties.java 1496 2006-05-23 13:38:33Z benalex $
27: */
28: public class ServiceProperties implements InitializingBean {
29: //~ Instance fields ================================================================================================
30:
31: private String service;
32: private boolean sendRenew = false;
33:
34: //~ Methods ========================================================================================================
35:
36: public void afterPropertiesSet() throws Exception {
37: if ((service == null) || "".equals(service)) {
38: throw new IllegalArgumentException(
39: "service must be specified");
40: }
41: }
42:
43: /**
44: * Represents the service the user is authenticating to.<p>This service is the callback URL belonging to
45: * the local Acegi Security System for Spring secured application. For example,</p>
46: * <code>https://www.mycompany.com/application/j_acegi_cas_security_check</code>
47: *
48: * @return the URL of the service the user is authenticating to
49: */
50: public String getService() {
51: return service;
52: }
53:
54: /**
55: * Indicates whether the <code>renew</code> parameter should be sent to the CAS login URL and CAS
56: * validation URL.<p>If <code>true</code>, it will force CAS to authenticate the user again (even if the
57: * user has previously authenticated). During ticket validation it will require the ticket was generated as a
58: * consequence of an explicit login. High security applications would probably set this to <code>true</code>.
59: * Defaults to <code>false</code>, providing automated single sign on.</p>
60: *
61: * @return whether to send the <code>renew</code> parameter to CAS
62: */
63: public boolean isSendRenew() {
64: return sendRenew;
65: }
66:
67: public void setSendRenew(boolean sendRenew) {
68: this .sendRenew = sendRenew;
69: }
70:
71: public void setService(String service) {
72: this.service = service;
73: }
74: }
|