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: bojilova $'
|
11
|
* '$Date: 2000-10-24 13:03:07 -0700 (Tue, 24 Oct 2000) $'
|
12
|
* '$Revision: 503 $'
|
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() throws ConnectException;
|
43
|
|
44
|
/**
|
45
|
* Get the users for a particular group from the authentication service
|
46
|
*/
|
47
|
public String[] getUsers(String group) throws ConnectException;
|
48
|
|
49
|
/**
|
50
|
* Get all groups from the authentication service
|
51
|
*/
|
52
|
public String[] getGroups() throws ConnectException;
|
53
|
|
54
|
/**
|
55
|
* Get the groups for a particular user from the authentication service
|
56
|
*/
|
57
|
public String[] getGroups(String user) throws ConnectException;
|
58
|
|
59
|
/**
|
60
|
* Get attributes describing a user or group
|
61
|
*
|
62
|
* @param user the user for which the attribute list is requested
|
63
|
* @returns HashMap a map of attribute name to a Vector of values
|
64
|
*/
|
65
|
public HashMap getAttributes(String user)
|
66
|
throws ConnectException;
|
67
|
|
68
|
/**
|
69
|
* Get attributes describing a user or group
|
70
|
*
|
71
|
* @param user the user for which the attribute list is requested
|
72
|
* @param authuser the user for authenticating against the service
|
73
|
* @param password the password for authenticating against the service
|
74
|
* @returns HashMap a map of attribute name to a Vector of values
|
75
|
*/
|
76
|
public HashMap getAttributes(String user, String authuser, String password)
|
77
|
throws ConnectException;
|
78
|
}
|