KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > authentication > AuthenticationComponent


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.security.authentication;
18
19 import net.sf.acegisecurity.Authentication;
20
21 public interface AuthenticationComponent
22 {
23     
24     /**
25      * Authenticate
26      *
27      * @param userName
28      * @param password
29      * @throws AuthenticationException
30      */

31     public void authenticate(String JavaDoc userName, char[] password) throws AuthenticationException;
32
33     /**
34      * Authenticate using a token
35      *
36      * @param token Authentication
37      * @return Authentication
38      * @throws AuthenticationException
39      */

40     public Authentication authenticate(Authentication token) throws AuthenticationException;
41     
42     /**
43      * Explicitly set the current user to be authenticated.
44      */

45     
46     public Authentication setCurrentUser(String JavaDoc userName);
47     
48     /**
49      * Remove the current security information
50      *
51      */

52     public void clearCurrentSecurityContext();
53     
54     /**
55      * Explicitly set the current suthentication.
56      */

57     
58     public Authentication setCurrentAuthentication(Authentication authentication);
59     
60     /**
61      *
62      * @return
63      * @throws AuthenticationException
64      */

65     public Authentication getCurrentAuthentication() throws AuthenticationException;
66     
67     /**
68      * Set the system user as the current user.
69      *
70      * @return
71      */

72     public Authentication setSystemUserAsCurrentUser();
73     
74     
75     /**
76      * Set the guest user as the current user.
77      *
78      * @return
79      */

80     public Authentication setGuestUserAsCurrentUser();
81     
82     
83     /**
84      * Get the name of the system user
85      *
86      * @return
87      */

88     public String JavaDoc getSystemUserName();
89     
90     
91     /**
92      * Get the name of the guest user
93      *
94      * @return
95      */

96     public String JavaDoc getGuestUserName();
97     
98     /**
99      * Get the current user name.
100      *
101      * @return
102      * @throws AuthenticationException
103      */

104     public String JavaDoc getCurrentUserName() throws AuthenticationException;
105     
106     /**
107      * Get the enum that describes NTLM integration
108      *
109      * @return
110      */

111     public NTLMMode getNTLMMode();
112     
113     /**
114      * Get the MD4 password hash, as required by NTLM based authentication methods.
115      *
116      * @param userName
117      * @return
118      */

119     public String JavaDoc getMD4HashedPassword(String JavaDoc userName);
120 }
121
Popular Tags