mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-02 17:35:18 +00:00
- New public service method added to AuthenticationService component stack: guestUserAuthenticationAllowed() git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4981 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
133 lines
3.4 KiB
Java
133 lines
3.4 KiB
Java
/*
|
|
* Copyright (C) 2005 Alfresco, Inc.
|
|
*
|
|
* Licensed under the Mozilla Public License version 1.1
|
|
* with a permitted attribution clause. You may obtain a
|
|
* copy of the License at
|
|
*
|
|
* http://www.alfresco.org/legal/license.txt
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
* either express or implied. See the License for the specific
|
|
* language governing permissions and limitations under the
|
|
* License.
|
|
*/
|
|
package org.alfresco.repo.security.authentication;
|
|
|
|
import net.sf.acegisecurity.Authentication;
|
|
|
|
public interface AuthenticationComponent
|
|
{
|
|
|
|
/**
|
|
* Authenticate
|
|
*
|
|
* @param userName
|
|
* @param password
|
|
* @throws AuthenticationException
|
|
*/
|
|
public void authenticate(String userName, char[] password) throws AuthenticationException;
|
|
|
|
/**
|
|
* Authenticate using a token
|
|
*
|
|
* @param token Authentication
|
|
* @return Authentication
|
|
* @throws AuthenticationException
|
|
*/
|
|
public Authentication authenticate(Authentication token) throws AuthenticationException;
|
|
|
|
/**
|
|
* Explicitly set the current user to be authenticated.
|
|
*/
|
|
|
|
public Authentication setCurrentUser(String userName);
|
|
|
|
/**
|
|
* Remove the current security information
|
|
*
|
|
*/
|
|
public void clearCurrentSecurityContext();
|
|
|
|
/**
|
|
* Explicitly set the current suthentication. If the authentication is <tt>null</tt> the
|
|
* the current authentication is {@link #clearCurrentSecurityContext() cleared}.
|
|
*
|
|
* @param authentication the current authentication (may be <tt>null</tt>).
|
|
*
|
|
* @return Returns the modified authentication instance or <tt>null</tt> if it was cleared.
|
|
*/
|
|
public Authentication setCurrentAuthentication(Authentication authentication);
|
|
|
|
/**
|
|
*
|
|
* @return
|
|
* @throws AuthenticationException
|
|
*/
|
|
public Authentication getCurrentAuthentication() throws AuthenticationException;
|
|
|
|
/**
|
|
* Set the system user as the current user.
|
|
*
|
|
* @return
|
|
*/
|
|
public Authentication setSystemUserAsCurrentUser();
|
|
|
|
|
|
/**
|
|
* Set the guest user as the current user.
|
|
*
|
|
* @return
|
|
*/
|
|
public Authentication setGuestUserAsCurrentUser();
|
|
|
|
|
|
/**
|
|
* True if Guest user authentication is allowed, false otherwise
|
|
*
|
|
* @return
|
|
*/
|
|
public boolean guestUserAuthenticationAllowed();
|
|
|
|
|
|
/**
|
|
* Get the name of the system user
|
|
*
|
|
* @return
|
|
*/
|
|
public String getSystemUserName();
|
|
|
|
|
|
/**
|
|
* Get the name of the guest user
|
|
*
|
|
* @return
|
|
*/
|
|
public String getGuestUserName();
|
|
|
|
/**
|
|
* Get the current user name.
|
|
*
|
|
* @return
|
|
* @throws AuthenticationException
|
|
*/
|
|
public String getCurrentUserName() throws AuthenticationException;
|
|
|
|
/**
|
|
* Get the enum that describes NTLM integration
|
|
*
|
|
* @return
|
|
*/
|
|
public NTLMMode getNTLMMode();
|
|
|
|
/**
|
|
* Get the MD4 password hash, as required by NTLM based authentication methods.
|
|
*
|
|
* @param userName
|
|
* @return
|
|
*/
|
|
public String getMD4HashedPassword(String userName);
|
|
}
|