View Javadoc

1   /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
2    *
3    * Licensed under the Apache License, Version 2.0 (the "License");
4    * you may not use this file except in compliance with the License.
5    * You may obtain a copy of the License at
6    *
7    *     http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  
16  package org.acegisecurity.providers.rcp;
17  
18  import org.acegisecurity.GrantedAuthority;
19  
20  
21  /**
22   * Allows remote clients to attempt authentication.
23   *
24   * @author Ben Alex
25   * @version $Id: RemoteAuthenticationManager.java 1784 2007-02-24 21:00:24Z luke_t $
26   */
27  public interface RemoteAuthenticationManager {
28      //~ Methods ========================================================================================================
29  
30      /**
31       * Attempts to authenticate the remote client using the presented username and password. If authentication
32       * is successful, an array of <code>GrantedAuthority[]</code> objects will be returned.<p>In order to
33       * maximise remoting protocol compatibility, a design decision was taken to operate with minimal arguments and
34       * return only the minimal amount of information required for remote clients to enable/disable relevant user
35       * interface commands etc. There is nothing preventing users from implementing their own equivalent package that
36       * works with more complex object types.</p>
37       *
38       * @param username the username the remote client wishes to authenticate with.
39       * @param password the password the remote client wishes to authenticate with.
40       *
41       * @return all of the granted authorities the specified username and password have access to.
42       *
43       * @throws RemoteAuthenticationException if the authentication failed.
44       */
45      GrantedAuthority[] attemptAuthentication(String username, String password)
46          throws RemoteAuthenticationException;
47  }