Package org.beangle.security.core

Examples of org.beangle.security.core.Authentication


  protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response,
      FilterChain chain) throws IOException, ServletException {
    boolean addedToken = false;

    if (applyAnonymousForThisRequest(request)) {
      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      if (auth == null) {
        auth = createAuthentication(request);
        SecurityContextHolder.getContext().setAuthentication(auth);
        addedToken = true;
        logger.debug("Populated SecurityContextHolder with anonymous token: '{}'", auth);
View Full Code Here


  protected String determineExpiredUrl(HttpServletRequest request, SessionInfo info) {
    return expiredUrl;
  }

  private void doLogout(HttpServletRequest request, HttpServletResponse response) {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    for (LogoutHandler handler : handlers) {
      handler.logout(request, response, auth);
    }
  }
View Full Code Here

  public void doFilterHttp(HttpServletRequest request, HttpServletResponse response,
      FilterChain chain) throws IOException, ServletException {
    if (requiresAuthentication(request, response)) {
      logger.debug("Request is to process authentication");
      Authentication authResult;
      try {
        authResult = attemptAuthentication(request);
        if (null == authResult) { return; }
        sessionStrategy.onAuthentication(authResult, request, response);
      } catch (AuthenticationException failed) {
View Full Code Here

  @Override
  protected void doFilterHttp(HttpServletRequest request, HttpServletResponse response,
      FilterChain chain) throws IOException, ServletException {
    if (requiresLogout(request, response)) {
      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      logger.debug("Logging out user '{}' and redirecting to logout page", auth);
      handlerStack.logout(request, response, auth);
      String targetUrl = determineTargetUrl(request, response);
      RedirectUtils.sendRedirect(request, response, targetUrl);
      return;
View Full Code Here

    if (!getSecureObjectClass().isAssignableFrom(object.getClass())) { throw new IllegalArgumentException(
        "Security invocation attempted for object "
            + object.getClass().getName()
            + " but AbstractSecurityInterceptor only configured to support secure objects of type: "
            + getSecureObjectClass()); }
    Authentication authenticated = authenticateIfRequired();

    // Attempt authorization
    if (!authorityManager.isAuthorized(authenticated, object)) { throw new AuthorizationException(
        object, "access denied"); }
    logger.debug("Authorization successful");
View Full Code Here

   * false or the property <tt>alwaysReauthenticate</tt> has been set to true.
   *
   * @return an authenticated <tt>Authentication</tt> object.
   */
  private Authentication authenticateIfRequired() {
    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
    if (authentication.isAuthenticated() && !alwaysReauthenticate) {
      logger.debug("Previously Authenticated: {}", authentication);
      return authentication;
    }
    authentication = authenticationManager.authenticate(authentication);
    SecurityContextHolder.getContext().setAuthentication(authentication);
View Full Code Here

    while (iter.hasNext()) {
      AuthenticationProvider provider = iter.next();
      if (!provider.supports(toTest)) {
        continue;
      }
      Authentication result;
      try {
        result = provider.authenticate(auth);
        if (result != null) {
          copyDetails(auth, result);
          //sessionController.checkAuthenticationAllowed(result);
View Full Code Here

  protected Logger logger = LoggerFactory.getLogger(AbstractAuthenticationManager.class);

  public final Authentication authenticate(Authentication authRequest)
      throws AuthenticationException {
    try {
      Authentication auth = doAuthentication(authRequest);
      logger.debug("Successfully Authenticated: {}", auth);
      return auth;
    } catch (AuthenticationException e) {
      e.setAuthentication(authRequest);
      if (clearExtraInfo) {
View Full Code Here

   * @param response
   * @return
   */
  protected boolean requiresAuthentication(HttpServletRequest request,
      HttpServletResponse response) {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    if (auth == null) { return true; }
    return (null != authenticationAliveChecker) ? !authenticationAliveChecker.check(auth,
        request) : false;
  }
View Full Code Here

  /**
   * Do the actual authentication for a pre-authenticated user.
   */
  private void doAuthenticate(HttpServletRequest request, HttpServletResponse response) {
    Authentication authResult = null;
    PreauthAuthentication auth = getPreauthAuthentication(request, response);
    if (auth == null) {
      logger.debug("No pre-authenticated principal found in request");
      return;
    } else {
View Full Code Here

TOP

Related Classes of org.beangle.security.core.Authentication

Copyright © 2018 www.massapicom. 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.