Examples of RequiresAuthentication


Examples of org.apache.shiro.authz.annotation.RequiresAuthentication

    boolean requiresAuthentication = false;

    try
    {
      RequiresAuthentication annotation = runtimeClass.getAnnotation(RequiresAuthentication.class);
      requiresAuthentication = (annotation != null);
    }
    catch (NullPointerException e)
    {
      requiresAuthentication = false;
    }

    if (requiresAuthentication && !ApplicationSecurity.isAuthenticated())
    {
      final String message = String.format("Authentication failed for %s on %s", userName, viewName);
      logger.warn(message);
      throw new AuthenticationException(message);
    }

    try
    {
      RequiresAuthentication annotation = method.getAnnotation(RequiresAuthentication.class);
      requiresAuthentication = (annotation != null);
    }
    catch (NullPointerException e)
    {
      requiresAuthentication = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.