edu.ucsd.auth
Class GridAuth

java.lang.Object
  extended byedu.ucsd.auth.GridAuth

public class GridAuth
extends Object

Grid-based Authentication and Authorization client API - fully implements the Grid-Auth API Specification.

Author:
Timothy J Warnock

Field Summary
protected  URL serviceHost
          The URL for auth service handling.
protected  Hashtable userMapHashTable
          A Hashtable that stores user-related values received from the service handler.
static String VERSION
          The GridAuth version.
 
Constructor Summary
GridAuth()
          This is the constructor method which simply allocates space.
 
Method Summary
 String get(String key)
          An access method that will query and return the value of a supplied key.
 String getKeys()
          A method to get the keys from the userMapHashTable.
 boolean isMember(String group)
          Authorization method to determine if a user is in a particular group.
 boolean login(String session)
          The login method in this form will attempt to authenticate with the default GridAuth test service handler (or other grid if the setServiceHandler method was used) using a supplied session hash.
 boolean login(String user, String pass)
          The login method in this form will attempt to authenticate with the default GridAuth service handler (or other grid if the setServiceHandler method was used) using a supplied username and password.
 boolean logout()
          The logout method destroys local information, as well as remote session information.
 void setServiceHandler(String newServiceHost)
          Dynamically set the service handler at runtime (not recommended).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
The GridAuth version.

See Also:
Constant Field Values

userMapHashTable

protected Hashtable userMapHashTable
A Hashtable that stores user-related values received from the service handler.


serviceHost

protected URL serviceHost
The URL for auth service handling. Defaults to the GridAuth test service handler at "http://www.gridauth.com/handler.cgi"

Constructor Detail

GridAuth

public GridAuth()
This is the constructor method which simply allocates space. The constructor does not communicate with the service handler in any way.

Method Detail

setServiceHandler

public void setServiceHandler(String newServiceHost)
Dynamically set the service handler at runtime (not recommended).

Parameters:
newServiceHost - host url string for the auth service handler

login

public boolean login(String user,
                     String pass)
The login method in this form will attempt to authenticate with the default GridAuth service handler (or other grid if the setServiceHandler method was used) using a supplied username and password.

Parameters:
user - login username
pass - password for the user login
Returns:
true IFF login was successful, false otherwise

login

public boolean login(String session)
The login method in this form will attempt to authenticate with the default GridAuth test service handler (or other grid if the setServiceHandler method was used) using a supplied session hash. A session hash is available to all authenticated services and is used to enable advanced pipelines and workflows where credentials can be shared from one application to another on a time sensitive basis. This form of login is necessary to support a single-sign-on environment across grid services.

Parameters:
session - hash identifying current session.
Returns:
true IFF login was successful, false otherwise

logout

public boolean logout()
The logout method destroys local information, as well as remote session information. This method should be called at the end of a session, not necessarily at the end of a program. That is, a program that may exist in a larger pipeline should not call this function unless they deliberately want to terminate the entire session.

Returns:
true IFF logout was successful, false otherwise

get

public String get(String key)
An access method that will query and return the value of a supplied key.

Parameters:
key - userMapHashTable key
Returns:
userMapHashTable value as a string.

getKeys

public String getKeys()
A method to get the keys from the userMapHashTable.

Returns:
key list as a String

isMember

public boolean isMember(String group)
Authorization method to determine if a user is in a particular group.

Parameters:
group - query group
Returns:
true IFF authenticated user is a member of group