|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.AspectComponent | +--org.objectweb.jac.aspects.authentication.AuthenticationAC
This AC weaves the authentication aspect.
The authentication ensures that the authenticated method are called only when the user is known in the context. An external controller (such as the one defined by the user aspect) can by used to actually grant of refuse the access.
AuthenticationWrapper
,
UserAC
,
Serialized FormField Summary | |
protected HashSet |
trustedUsers
Stores the trusted users. |
static String |
USER
The contextual attribute that contains the authenticated user if any. |
Fields inherited from class org.objectweb.jac.core.AspectComponent |
application, blockKeywords, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers |
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener |
FOUND_OBJECT |
Constructor Summary | |
AuthenticationAC()
|
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 |
addTrustedUser(String username)
|
Set |
getTrustedUsers()
Returns all the declared trusted users. |
boolean |
isTrustedUser(String username)
Tells if a given user is trusted or not. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String USER
protected HashSet trustedUsers
Constructor Detail |
public AuthenticationAC()
Method Detail |
public boolean isTrustedUser(String username)
username
- the user's name
public Set getTrustedUsers()
addTrustedUser(String)
public void addTrustedUser(String username)
public void setController(String classes, String methods, MethodItem controller)
AuthenticationConf
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.
setController
in interface AuthenticationConf
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)
)AuthenticationConf.setDisplayController(MethodItem)
,
UserAC.userController(String,Object,MethodItem)
,
AuthenticationWrapper.dummyController(String,Object,MethodItem)
,
AuthenticationWrapper
public void setDisplayController(MethodItem controller)
AuthenticationConf
setDisplayController
in interface AuthenticationConf
controller
- the controller method (a static method of the
prototype boolean controller(String username,Object
wrappee,MethodItem method)
)AuthenticationConf.setController(String,String,MethodItem)
,
UserAC.userController(String,Object,MethodItem)
,
AuthenticationWrapper.dummyController(String,Object,MethodItem)
,
AuthenticationWrapper
public void setAccessDeniedMessage(String message)
AuthenticationConf
setAccessDeniedMessage
in interface AuthenticationConf
AuthenticationConf.setController(String,String,MethodItem)
public void addRestrictedMethods(String classes, String methods, String objects)
AuthenticationConf
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.
addRestrictedMethods
in interface AuthenticationConf
classes
- a class expressionobjects
- an object expressionmethods
- an expression matching the methods to restrictAuthenticationConf.addRestrictedObjects(String)
,
AuthenticationWrapper
public void addRestrictedObjects(String objects)
AuthenticationConf
addRestrictedObjects
in interface AuthenticationConf
objects
- an object expressionAuthenticationConf.addRestrictedMethods(String,String,String)
,
AuthenticationWrapper
public void addRestrictedObjects(String objects, String classes)
AuthenticationConf
addRestrictedObjects
in interface AuthenticationConf
classes
- a class expressionobjects
- an object expressionAuthenticationConf.addRestrictedMethods(String,String,String)
,
AuthenticationWrapper
public void setAuthenticator(ClassItem authenticatorClass)
AuthenticationConf
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.
setAuthenticator
in interface AuthenticationConf
authenticatorClass
- the authenticator's classAuthenticationConf.setAuthenticator(ClassItem,String[])
,
Authenticator
,
UserPasswordAuthenticator
public void setAuthenticator(ClassItem authenticatorClass, String[] parameters)
AuthenticationConf
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.
setAuthenticator
in interface AuthenticationConf
authenticatorClass
- the authenticator's classparameters
- parameters to give to the constructorAuthenticator
,
UserPasswordAuthenticator
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |