Package org.apache.shiro.authz.aop
Class AuthenticatedAnnotationHandler
- java.lang.Object
-
- org.apache.shiro.aop.AnnotationHandler
-
- org.apache.shiro.authz.aop.AuthorizingAnnotationHandler
-
- org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler
-
public class AuthenticatedAnnotationHandler extends AuthorizingAnnotationHandler
HandlesRequiresAuthenticationannotations and ensures the calling subject is authenticated before allowing access.- Since:
- 0.9.0
-
-
Field Summary
-
Fields inherited from class org.apache.shiro.aop.AnnotationHandler
annotationClass
-
-
Constructor Summary
Constructors Constructor Description AuthenticatedAnnotationHandler()Default no-argument constructor that ensures this handler to processRequiresAuthenticationannotations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertAuthorized(Annotation a)Ensures that the callingSubjectis authenticated, and if not, throws anUnauthenticatedExceptionindicating the method is not allowed to be executed.-
Methods inherited from class org.apache.shiro.aop.AnnotationHandler
getAnnotationClass, getSubject, setAnnotationClass
-
-
-
-
Constructor Detail
-
AuthenticatedAnnotationHandler
public AuthenticatedAnnotationHandler()
Default no-argument constructor that ensures this handler to processRequiresAuthenticationannotations.
-
-
Method Detail
-
assertAuthorized
public void assertAuthorized(Annotation a) throws UnauthenticatedException
Ensures that the callingSubjectis authenticated, and if not, throws anUnauthenticatedExceptionindicating the method is not allowed to be executed.- Specified by:
assertAuthorizedin classAuthorizingAnnotationHandler- Parameters:
a- the annotation to inspect- Throws:
UnauthenticatedException- if the callingSubjecthas not yet authenticated.
-
-