org.apache.shiro.authz.aop
Class AuthenticatedAnnotationHandler

java.lang.Object
  extended by org.apache.shiro.aop.AnnotationHandler
      extended by org.apache.shiro.authz.aop.AuthorizingAnnotationHandler
          extended by org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler

public class AuthenticatedAnnotationHandler
extends AuthorizingAnnotationHandler

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
AuthenticatedAnnotationHandler()
          Default no-argument constructor that ensures this handler to process RequiresAuthentication annotations.
 
Method Summary
 void assertAuthorized(Annotation a)
          Ensures that the calling Subject is authenticated, and if not, throws an UnauthenticatedException indicating the method is not allowed to be executed.
 
Methods inherited from class org.apache.shiro.aop.AnnotationHandler
getAnnotationClass, getSubject, setAnnotationClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticatedAnnotationHandler

public AuthenticatedAnnotationHandler()
Default no-argument constructor that ensures this handler to process RequiresAuthentication annotations.

Method Detail

assertAuthorized

public void assertAuthorized(Annotation a)
                      throws UnauthenticatedException
Ensures that the calling Subject is authenticated, and if not, throws an UnauthenticatedException indicating the method is not allowed to be executed.

Specified by:
assertAuthorized in class AuthorizingAnnotationHandler
Parameters:
a - the annotation to inspect
Throws:
UnauthenticatedException - if the calling Subject has not yet authenticated.


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.