wt.auth
Class Authentication

java.lang.Object
  extended bywt.auth.Authentication
All Implemented Interfaces:
RemoteAccess

public class Authentication
extends Object
implements RemoteAccess

Authentication service. This class forwards calls to a server-side authentication server class.

Supported API: true
Extendable: false


Field Summary
private static Object ALLOW_USER_INTERACTION_KEY
           
private static String CLASSNAME
           
private static boolean defaultAllowUserInteraction
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
private Authentication()
           
 
Method Summary
private static String _getUserName()
           
private static MethodAuthenticator _init(MethodAuthenticator authenticator)
           
private static void _reauthenticateUser()
           
static boolean getAllowUserInteraction()
          Get whether the current WTContext should allow user interaction to carry out authentication.
static boolean getDefaultAllowUserInteraction()
          Get default setting of whether user interation should be allowed to carry out authentication.
static String getUserName()
          Get authenticated user name for the current thread.
static MethodAuthenticator init(MethodAuthenticator authenticator)
          Initialization method called from bootstrapping authenticator's init method.
static void main(String[] args)
          Simple tester.
static void reauthenticateUser()
          Re-authenticate the user name for the current thread.
private static boolean SERVER()
           
static void setAllowUserInteraction(boolean allow_user_interaction)
          Set whether the current WTContext should allow user interaction to carry out authentication.
static void setDefaultAllowUserInteraction(boolean allow_user_interaction)
          Set default value for whether user interation should be allowed to carry out authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

private static final String CLASSNAME

ALLOW_USER_INTERACTION_KEY

private static Object ALLOW_USER_INTERACTION_KEY

defaultAllowUserInteraction

private static boolean defaultAllowUserInteraction
Constructor Detail

Authentication

private Authentication()
Method Detail

SERVER

private static final boolean SERVER()

getUserName

public static String getUserName()
                          throws RemoteException
Get authenticated user name for the current thread. If the client has not yet been authenticated, this may result in a MethodAuthenticator object being thrown back to the client to perform a secure login.

Supported API: true

Returns:
the authenticated user name
Throws:
RemoteException

_getUserName

private static String _getUserName()

init

public static MethodAuthenticator init(MethodAuthenticator authenticator)
                                throws RemoteException
Initialization method called from bootstrapping authenticator's init method. It can be used to convert bootstrapping authenticator into a real one or to send back another bootstrapping authenticator if the current one failed and there are other login mechanisms available.

Supported API: true

Parameters:
authenticator - the MethodAuthenticator being initialized
Returns:
replacement MethodAuthenticator
Throws:
RemoteException

_init

private static MethodAuthenticator _init(MethodAuthenticator authenticator)

reauthenticateUser

public static void reauthenticateUser()
                               throws RemoteException
Re-authenticate the user name for the current thread. This will result in a MethodAuthenticator object being thrown back to the client to perform a secure login.

Supported API: true

Returns:
the authenticated user name
Throws:
RemoteException

_reauthenticateUser

private static void _reauthenticateUser()

getAllowUserInteraction

public static boolean getAllowUserInteraction()
Get whether the current WTContext should allow user interaction to carry out authentication. This setting can be used by bootstrapping method authenticators to determine if interaction is allowed. The default is true.

Supported API: true

Returns:
true if user interaction is allowed, false if not.

setAllowUserInteraction

public static void setAllowUserInteraction(boolean allow_user_interaction)
Set whether the current WTContext should allow user interaction to carry out authentication. This setting can be used by bootstrapping method authenticators to determine if interaction is allowed. The default is true.

Supported API: true

Parameters:
allow_user_interaction - true if user interaction is allowed, false if not.

getDefaultAllowUserInteraction

public static boolean getDefaultAllowUserInteraction()
Get default setting of whether user interation should be allowed to carry out authentication.

Supported API: true

Returns:
true if user interaction is allowed, false if not.

setDefaultAllowUserInteraction

public static void setDefaultAllowUserInteraction(boolean allow_user_interaction)
Set default value for whether user interation should be allowed to carry out authentication.

Supported API: true

Parameters:
allow_user_interaction - true if user interaction is allowed, false if not.

main

public static void main(String[] args)
                 throws RemoteException,
                        InterruptedException
Simple tester. Calls Authentication.getUserName(). If the first argument is -r, it will then try reauthentication. If user= and password= arguments are specified, they will be made available to username/password based authentication handlers.

Supported API: true

Throws:
RemoteException
InterruptedException