org.jdesktop.wonderland.common.login
Class AuthenticationManager

java.lang.Object
  extended by org.jdesktop.wonderland.common.login.AuthenticationManager

public class AuthenticationManager
extends java.lang.Object

The authentication manager manages multiple authentication sources. Each source is identified by URL.

Author:
jkaplan

Constructor Summary
AuthenticationManager()
           
 
Method Summary
static AuthenticationService get(java.lang.String url)
          Get an existing authentication service for the given URL
static AuthenticationService login(AuthenticationInfo info, java.lang.String username, java.lang.Object... credentials)
          Log in to the server identified by the given authentication information with the given credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationManager

public AuthenticationManager()
Method Detail

get

public static AuthenticationService get(java.lang.String url)
Get an existing authentication service for the given URL

Parameters:
URL - the authentication URL for the server
Returns:
an existing authentication service for the given URL, or null if no service exists

login

public static AuthenticationService login(AuthenticationInfo info,
                                          java.lang.String username,
                                          java.lang.Object... credentials)
                                   throws AuthenticationException
Log in to the server identified by the given authentication information with the given credentials. The mechanism for login will depend on the type of authentication.

If an existing authentication service exists for the authentication url contained in the info object, the service will first be test for validity using isTokenValid(). If the token is valid, the existing service will be returned. If the token is not valid, the service will be updated to use the new credentials. Existing instances of the service should still work, although information like username and token may have changed. This implies that there can only be a single login to a particular URL active at any time.

Parameters:
info - the information about the server to authenticate to
credentials - the credentials to use for login
Returns:
the AuthenticationService for the given credentials.
Throws:
InvalidLoginException - if the authentication credentials are invalid
AuthenticationException - if there is an error authenticating


Open Wonderland - http://openwonderland.org