Examples of InsufficientAuthenticationException


Examples of org.springframework.security.authentication.InsufficientAuthenticationException

                if (logger.isDebugEnabled()) {
                    logger.debug("Access is denied (user is anonymous); redirecting to authentication entry point",
                            exception);
                }

                sendStartAuthentication(request, response, chain, new InsufficientAuthenticationException(
                        "Full authentication is required to access this resource"));
            }
            else {
                if (logger.isDebugEnabled()) {
                    logger.debug("Access is denied (user is not anonymous); delegating to AccessDeniedHandler",
View Full Code Here

Examples of org.springframework.security.authentication.InsufficientAuthenticationException

                        return;
                    }
                }
            }

            throw new InsufficientAuthenticationException("Response doesn't contain any of the requested authentication context class or declaration references");

        }

    }
View Full Code Here

Examples of org.springframework.security.authentication.InsufficientAuthenticationException

          .createAuthenticationFromUserDetails(user);
    } else if (allowRepeatedAuthenticationAttempts
        && alreadyAuthenticatedUserId != null) {
      return SecurityContextHolder.getContext().getAuthentication();
    } else {
      throw new InsufficientAuthenticationException(
          "SpringSocialSecurity sign in details not found in session");
    }
  }
View Full Code Here

Examples of org.springframework.security.authentication.InsufficientAuthenticationException

    public static RuntimeException unauthorizedAccess(String resourceName) {
        // not hide, and not filtering out a list, this
        // is an unauthorized direct resource access, complain
        Authentication user = user();
        if (user == null || user.getAuthorities().size() == 0)
            return new InsufficientAuthenticationException("Cannot access "
                    + resourceName + " as anonymous");
        else
            return new AccessDeniedException("Cannot access "
                    + resourceName + " with the current privileges");
    }
View Full Code Here

Examples of org.springframework.security.authentication.InsufficientAuthenticationException

    public static RuntimeException unauthorizedAccess() {
        // not hide, and not filtering out a list, this
        // is an unauthorized direct resource access, complain
        Authentication user = user();
        if (user == null || user.getAuthorities().size() == 0)
            return new InsufficientAuthenticationException("Operation unallowed with the current privileges");
        else
            return new AccessDeniedException("Operation unallowed with the current privileges");
    }
View Full Code Here

Examples of org.springframework.security.authentication.InsufficientAuthenticationException

            // user is authenticated and has one of the required roles
            if(!allowedRoles.contains(ServiceAccessRule.ANY) && !allowedRoles.isEmpty()) {
                Authentication user = SecurityContextHolder.getContext().getAuthentication();
               
                if (user == null || user.getAuthorities().size() == 0)
                    throw new InsufficientAuthenticationException("Cannot access "
                            + service + "." + method + " as anonymous");
               
                boolean roleFound = false;
                for (GrantedAuthority role : user.getAuthorities()) {
                    if(allowedRoles.contains(role.getAuthority())) {
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.