JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.authentication
Interface AuthenticationConf

All Known Implementing Classes:
AuthenticationAC

public interface AuthenticationConf

This is the configuration interface of the authentication aspect.

The authentication aspect's goal is to make sure that a user attribute is defined within the context. Several authentication policies are available and defined in the controller.

See Also:
AuthenticationAC, setAuthenticator(ClassItem), setAuthenticator(ClassItem,String[])

Method Summary
 void addRestrictedMethods(String classes, String methods, String objects)
          This configuration method restricts a given set of methods.
 void addRestrictedObjects(String objects)
          Restricts some objects for authentication (all their methods).
 void addRestrictedObjects(String objects, String classes)
          Restricts some objects for authentication.
 void setAccessDeniedMessage(String msg)
          Sets the message that is showed to the user when the access to a method is not granted by the controller (if any).
 void setAuthenticator(ClassItem authenticatorClass)
          Sets the authenticator to use when the authenticator's constructor takes no parameters.
 void setAuthenticator(ClassItem authenticatorClass, String[] parameters)
          Sets the authenticator to use.
 void setController(String classes, String methods, MethodItem controller)
          This configuration method sets a controller method to a set of base methods.
 void setDisplayController(MethodItem controller)
          This configuration method sets a controller on displays so that all users must authenticate themselves before accessing the application.
 

Method Detail

addRestrictedMethods

public void addRestrictedMethods(String classes,
                                 String methods,
                                 String objects)
This configuration method restricts a given set of methods.

When a method is restricted, the collaboration that contains the restricted method invocation must contain an attribute that represents the current user. If not, the authentication aspect ask the user to input its caracteristics.

Parameters:
classes - a class expression
objects - an object expression
methods - an expression matching the methods to restrict
See Also:
addRestrictedObjects(String), AuthenticationWrapper

setController

public void setController(String classes,
                          String methods,
                          MethodItem controller)
This configuration method sets a controller method to a set of base methods.

Once the user is authenticated, the controller method is called with the user and the wrappee and the wrapped method as parameters. If the controller returns true, the user is allowed to call the method, otherwise an exception is raised.

Parameters:
classes - a class expression
methods - an expression matching the methods to restrict
controller - the controller method (a static method of the prototype boolean controller(String username,Object wrappee,MethodItem method))
See Also:
setDisplayController(MethodItem), UserAC.userController(String,Object,MethodItem), AuthenticationWrapper.dummyController(String,Object,MethodItem), AuthenticationWrapper

setDisplayController

public void setDisplayController(MethodItem controller)
This configuration method sets a controller on displays so that all users must authenticate themselves before accessing the application.

Parameters:
controller - the controller method (a static method of the prototype boolean controller(String username,Object wrappee,MethodItem method))
See Also:
setController(String,String,MethodItem), UserAC.userController(String,Object,MethodItem), AuthenticationWrapper.dummyController(String,Object,MethodItem), AuthenticationWrapper

setAccessDeniedMessage

public void setAccessDeniedMessage(String msg)
Sets the message that is showed to the user when the access to a method is not granted by the controller (if any).

See Also:
setController(String,String,MethodItem)

addRestrictedObjects

public void addRestrictedObjects(String objects)
Restricts some objects for authentication (all their methods).

Parameters:
objects - an object expression
See Also:
addRestrictedMethods(String,String,String), AuthenticationWrapper

addRestrictedObjects

public void addRestrictedObjects(String objects,
                                 String classes)
Restricts some objects for authentication.

Parameters:
classes - a class expression
objects - an object expression
See Also:
addRestrictedMethods(String,String,String), AuthenticationWrapper

setAuthenticator

public void setAuthenticator(ClassItem authenticatorClass,
                             String[] parameters)
Sets the authenticator to use.

The most used authenticator is the org.objectweb.jac.aspects.authentication.UserPasswordAuthenticator. It opens a popup on the current display to ask the user its login and password.

Parameters:
authenticatorClass - the authenticator's class
parameters - parameters to give to the constructor
See Also:
Authenticator, UserPasswordAuthenticator

setAuthenticator

public void setAuthenticator(ClassItem authenticatorClass)
Sets the authenticator to use when the authenticator's constructor takes no parameters.

The most used authenticator is the org.objectweb.jac.aspects.authentication.UserPasswordAuthenticator. It opens a popup on the current display to ask the user its login and password.

Parameters:
authenticatorClass - the authenticator's class
See Also:
setAuthenticator(ClassItem,String[]), Authenticator, UserPasswordAuthenticator

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli