View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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  package org.kuali.rice.kim.api.identity;
17  
18  import javax.servlet.http.HttpServletRequest;
19  
20  /**
21   * This service is used to extract the name of the authenticated principal from
22   * an incoming http request.  Depending on the implementation of this service,
23   * it may extract information from a request which has already been authenticated
24   * (i.e. via another service like CAS or Shiboleth).  Alternatively, this
25   * implementation might actually perform the authentication itself based on
26   * information available on the http request.
27   * 
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   * 
30   */
31  public interface AuthenticationService {
32  	
33  	/**
34  	 * Returns the principalName of the principal that has authenticated with
35  	 * the incoming HttpServletRequest.  Implementations of this method might
36  	 * perform actual authentication or merely extract the existing
37  	 * authenticated principal's name off of the incoming request.
38  	 * 
39  	 * @param request the incoming HttpServletRequest
40  	 * @return the principalName of the authenticated principal, or null if
41  	 * the principal could not be authenticated
42  	 */
43      String getPrincipalName(HttpServletRequest request);
44  }