Class AuthenticatedAnnotationHandler
java.lang.Object
org.apache.shiro.aop.AnnotationHandler
org.apache.shiro.authz.aop.AuthorizingAnnotationHandler
org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler
Handles
RequiresAuthentication 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
ConstructorsConstructorDescriptionDefault no-argument constructor that ensures this handler to processRequiresAuthenticationannotations. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnsures 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 Details
-
AuthenticatedAnnotationHandler
public AuthenticatedAnnotationHandler()Default no-argument constructor that ensures this handler to processRequiresAuthenticationannotations.
-
-
Method Details
-
assertAuthorized
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.
-