|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 message)
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 |
public void addRestrictedMethods(String classes, String methods, String objects)
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.
classes
- a class expressionobjects
- an object expressionmethods
- an expression matching the methods to restrictaddRestrictedObjects(String)
,
AuthenticationWrapper
public void setController(String classes, String methods, MethodItem controller)
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.
classes
- a class expressionmethods
- an expression matching the methods to restrictcontroller
- the controller method (a static method of the
prototype boolean controller(String username,Object
wrappee,MethodItem method)
)setDisplayController(MethodItem)
,
UserAC.userController(String,Object,MethodItem)
,
AuthenticationWrapper.dummyController(String,Object,MethodItem)
,
AuthenticationWrapper
public void setDisplayController(MethodItem controller)
controller
- the controller method (a static method of the
prototype boolean controller(String username,Object
wrappee,MethodItem method)
)setController(String,String,MethodItem)
,
UserAC.userController(String,Object,MethodItem)
,
AuthenticationWrapper.dummyController(String,Object,MethodItem)
,
AuthenticationWrapper
public void setAccessDeniedMessage(String message)
message
- the message to popupsetController(String,String,MethodItem)
public void addRestrictedObjects(String objects)
objects
- an object expressionaddRestrictedMethods(String,String,String)
,
AuthenticationWrapper
public void addRestrictedObjects(String objects, String classes)
classes
- a class expressionobjects
- an object expressionaddRestrictedMethods(String,String,String)
,
AuthenticationWrapper
public void setAuthenticator(ClassItem authenticatorClass, String[] 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.
authenticatorClass
- the authenticator's classparameters
- parameters to give to the constructorAuthenticator
,
UserPasswordAuthenticator
public void setAuthenticator(ClassItem authenticatorClass)
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.
authenticatorClass
- the authenticator's classsetAuthenticator(ClassItem,String[])
,
Authenticator
,
UserPasswordAuthenticator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |