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
HandlesRequiresAuthentication
annotations 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 processRequiresAuthentication
annotations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertAuthorized(Annotation a)
Ensures that the callingSubject
is authenticated, and if not, throws anUnauthenticatedException
indicating 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 processRequiresAuthentication
annotations.
-
-
Method Detail
-
assertAuthorized
public void assertAuthorized(Annotation a) throws UnauthenticatedException
Ensures that the callingSubject
is authenticated, and if not, throws anUnauthenticatedException
indicating the method is not allowed to be executed.- Specified by:
assertAuthorized
in classAuthorizingAnnotationHandler
- Parameters:
a
- the annotation to inspect- Throws:
UnauthenticatedException
- if the callingSubject
has not yet authenticated.
-
-