View Javadoc

1   /*
2    * Copyright 2007 University Corporation for Advanced Internet Development, Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package edu.internet2.middleware.shibboleth.common.relyingparty.provider.saml2;
18  
19  /** SAML 2 SSO configuration settings. */
20  public class SSOConfiguration extends AbstractSAML2ProfileConfiguration {
21  
22      /** ID for this profile configuration. */
23      public static final String PROFILE_ID = "urn:mace:shibboleth:2.0:profiles:saml2:sso";
24  
25      /** Whether responses to the authentication request should include an attribute statement. */
26      private boolean includeAttributeStatement;
27  
28      /** The maximum amount of time, in milliseconds, the service provider should maintain a session for the user. */
29      private long maximumSPSessionLifetime;
30  
31      /** {@inheritDoc} */
32      public String getProfileId() {
33          return PROFILE_ID;
34      }
35  
36      /**
37       * Gets whether responses to the authentication request should include an attribute statement.
38       * 
39       * @return whether responses to the authentication request should include an attribute statement
40       */
41      public boolean includeAttributeStatement() {
42          return includeAttributeStatement;
43      }
44  
45      /**
46       * Sets whether responses to the authentication request should include an attribute statement.
47       * 
48       * @param include whether responses to the authentication request should include an attribute statement
49       */
50      public void setIncludeAttributeStatement(boolean include) {
51          includeAttributeStatement = include;
52      }
53  
54      /**
55       * Gets the maximum amount of time, in milliseconds, the service provider should maintain a session for the user
56       * based on the authentication assertion. A value less than or equal to 0 is interpreted as an unlimited lifetime.
57       * 
58       * @return max lifetime of service provider should maintain a session
59       */
60      public long getMaximumSPSessionLifetime() {
61          return maximumSPSessionLifetime;
62      }
63  
64      /**
65       * Sets the maximum amount of time, in milliseconds, the service provider should maintain a session for the user
66       * based on the authentication assertion. A value less than or equal to 0 is interpreted as an unlimited lifetime.
67       * 
68       * @param lifetime max lifetime of service provider should maintain a session
69       */
70      public void setMaximumSPSessionLifetime(long lifetime) {
71          if (lifetime < 1) {
72              maximumSPSessionLifetime = 0;
73          } else {
74              maximumSPSessionLifetime = lifetime;
75          }
76      }
77  }