View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2005 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  
18  package ch.elca.el4j.services.security.authentication;
19  
20  import org.springframework.security.core.Authentication; 
21  
22  
23  
24  /**
25   * AuthenticationService interface. Provides methods to log in and out. If you
26   * are already logged in, you have to log out first and then log in again.
27   *
28   * @svnLink $Revision: 4091 $;$Date: 2010-01-15 12:21:07 +0100 (Fr, 15. Jan 2010) $;$Author: jonasha $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/security/src/main/java/ch/elca/el4j/services/security/authentication/AuthenticationService.java $
29   *
30   * @author Raphael Boog (RBO)
31   * @author Andreas Pfenninger (APR)
32   * @author Christoph Schwitter (CSC)
33   */
34  
35  
36  
37  public interface AuthenticationService {
38  
39  	/**
40  	 * Authenticate using the given Authentication object.
41  	 * @param auth The Authentication object.
42  	 */
43  	public void authenticate(Authentication auth);
44  
45  	/**
46  	 * After a login method has been called, or the user is authenticated in any
47  	 * other way, the authentication data object as constructed during the
48  	 * authentication process can be accessed using this method.
49  	 *
50  	 * @return The authentication data object representing the user.
51  	 */
52  	public Authentication getAuthenticationData();
53  
54  	/**
55  	 * After the user has logged in, the user's name can be accessed using this
56  	 * method.
57  	 *
58  	 * @return The name of the logged in user.
59  	 */
60  	public String getUserName();
61  
62  }