Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *    Purpose: An interface representing the methods that should be 
4
 *             implemented by an authentication service
5
 *  Copyright: 2000 Regents of the University of California and the
6
 *             National Center for Ecological Analysis and Synthesis
7
 *    Authors: Matt Jones
8
 *    Release: @release@
9
 *
10
 *   '$Author: jones $'
11
 *     '$Date: 2000-11-06 17:21:36 -0800 (Mon, 06 Nov 2000) $'
12
 * '$Revision: 514 $'
13
 */
14

    
15
package edu.ucsb.nceas.metacat;
16

    
17
import java.net.ConnectException;
18
import java.util.HashMap;
19

    
20
/**
21
 * An interface representing the methods that should be 
22
 * implemented by an authentication service.  The authentication service is
23
 * used to determine if a user is authenticated, and whether they are a member 
24
 * of a particular group.
25
 */
26
public interface AuthInterface {
27

    
28
  /**
29
   * Determine if a user/password are valid according to the authentication
30
   * service.
31
   *
32
   * @param user the name of the principal to authenticate
33
   * @param password the password to use for authentication
34
   * @returns boolean true if authentication successful, false otherwise
35
   */
36
  public boolean authenticate(String user, String password)
37
         throws ConnectException;
38

    
39
  /**
40
   * Get all users from the authentication service
41
   */
42
  public String[] getUsers(String user, String password) 
43
         throws ConnectException;
44

    
45
  /**
46
   * Get the users for a particular group from the authentication service
47
   */
48
  public String[] getUsers(String user, String password, String group)
49
         throws ConnectException;
50

    
51
  /**
52
   * Get all groups from the authentication service
53
   */
54
  public String[] getGroups(String user, String password)
55
         throws ConnectException;
56

    
57
  /**
58
   * Get the groups for a particular user from the authentication service
59
   */
60
  public String[] getGroups(String user, String password, String foruser)
61
         throws ConnectException;
62

    
63
  /**
64
   * Get attributes describing a user or group
65
   *
66
   * @param user the user for which the attribute list is requested
67
   * @returns HashMap a map of attribute name to a Vector of values
68
   */
69
  public HashMap getAttributes(String foruser) 
70
         throws ConnectException;
71

    
72
  /**
73
   * Get attributes describing a user or group
74
   *
75
   * @param user the user for which the attribute list is requested
76
   * @param authuser the user for authenticating against the service
77
   * @param password the password for authenticating against the service
78
   * @returns HashMap a map of attribute name to a Vector of values
79
   */
80
  public HashMap getAttributes(String user, String password, String foruser) 
81
         throws ConnectException;
82
}
(4-4/38)