Package wt.auth
Class AuthenticationServer
java.lang.Object
wt.auth.AuthenticationServer
Authentication service.
This class works in conjunction with a set of
AuthenticationHandler objects,
an Authenticator object and MethodAuthenticator objects to securely
establish the identity of a client. The AuthenticationHandler objects are
responsible for authentication schemes and initially identifying the user. The
Authenticator and MethodAuthenticator objects are responsible
for securely associating that identity with subsequent calls.
A typical scenario involves this class throwing an AuthenticationException that includes
a bootstraping MethodAuthenticator object. This MethodAuthenticator object executes
on the client to perform a secure login. This activity results in the creation of
a second MethodAuthenticator object that can endorse client method calls in a way
that be securely verified by the Authenticator class.
Supported API: true
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCheck if given authentication handler is enabled.static MethodAuthenticatorGet a bootstrapMethodAuthenticatorcapable of identifying the user.static MethodAuthenticatorgetBootstrapAuthenticator(String session_id) Get a bootstrapMethodAuthenticatorcapable of identifying the user for a given session.static StringGet authenticated user name for the current thread.static MethodAuthenticatorinit(MethodAuthenticator authenticator) Initialization method called from bootstrapping authenticator's init method.static MethodAuthenticatornewMethodAuthenticator(String user) Create a newMethodAuthenticatorobject that will associate the given user name to endorsed method calls.static MethodAuthenticatornewMethodAuthenticator(String user, String session_id) Create a newMethodAuthenticatorobject that will associate the given user name to endorsed method calls.static voidRe-authenticate the user name for the current thread.static voidsetUserName(String user) Set authenticated user name for the current thread.
-
Method Details
-
getBootstrapAuthenticator
Get a bootstrapMethodAuthenticatorcapable of identifying the user.
Supported API: true- Returns:
MethodAuthenticatorobject
-
getBootstrapAuthenticator
Get a bootstrapMethodAuthenticatorcapable of identifying the user for a given session.
Supported API: true- Parameters:
session_id- a string identifying the session to be authenticated- Returns:
MethodAuthenticatorobject
-
getUserName
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
-
setUserName
Set authenticated user name for the current thread. This will override any current authentication context with one for the given user.
Supported API: true -
init
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- theMethodAuthenticatorbeing initialized- Returns:
- replacement
MethodAuthenticator
-
newMethodAuthenticator
Create a newMethodAuthenticatorobject that will associate the given user name to endorsed method calls.
Supported API: true- Parameters:
user- the authenticated user name- Returns:
MethodAuthenticatorobject
-
newMethodAuthenticator
Create a newMethodAuthenticatorobject that will associate the given user name to endorsed method calls.
Supported API: true- Parameters:
user- the authenticated user nameobj- object that is used to identify an instance of the authenticator.- Returns:
MethodAuthenticatorobject
-
enabled
Check if given authentication handler is enabled.
Supported API: true- Parameters:
handler- theAuthenticationHandlerclass- Returns:
- true if the given handler class is currently enabled
-
reauthenticateUser
public static void reauthenticateUser()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
-