1 /* 2 * Copyright 2006 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.idp.session; 18 19 import java.io.Serializable; 20 import java.security.Principal; 21 22 import javax.security.auth.Subject; 23 24 import org.joda.time.DateTime; 25 26 /** Information about an authentication method employed by a user. */ 27 public interface AuthenticationMethodInformation extends Serializable { 28 29 /** 30 * Gets the Subject created by this authentication method. 31 * 32 * @return subject created by this authentication method 33 * 34 * @deprecated use {@link Session#getSubject()} 35 */ 36 public Subject getAuthenticationSubject(); 37 38 /** 39 * Gets the principal, for the {@link Subject} of the session, created by this authentication method. 40 * 41 * @return principal created by this authentication method 42 */ 43 public Principal getAuthenticationPrincipal(); 44 45 /** 46 * Gets the unique identifier for the authentication method. 47 * 48 * @return unique identifier for the authentication method 49 */ 50 public String getAuthenticationMethod(); 51 52 /** 53 * Gets the time the user authenticated with this member. 54 * 55 * @return time the user authenticated with this member 56 */ 57 public DateTime getAuthenticationInstant(); 58 59 /** 60 * Gets the duration of this authentication method. 61 * 62 * @return duration of this authentication method 63 */ 64 public long getAuthenticationDuration(); 65 66 /** 67 * Gets whether this authentication method has expired and is not longer valid for use in constructing new sessions. 68 * 69 * @return whether this authentication method has expired 70 */ 71 public boolean isExpired(); 72 }