Package org.springframework.security.web.access

Examples of org.springframework.security.web.access.AccessDeniedHandlerImpl


        AccessDeniedHandler handler = null;
        if(exceptionConfig != null) {
            handler = exceptionConfig.getAccessDeniedHandler();
        }
        if(handler == null) {
            handler = new AccessDeniedHandlerImpl();
        }
        return handler;
    }
View Full Code Here


     * @return the {@link ExceptionHandlingConfigurer} for further customization
     * @see AccessDeniedHandlerImpl
     * @see {@link #accessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler)}
     */
    public ExceptionHandlingConfigurer<H> accessDeniedPage(String accessDeniedUrl) {
        AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
        accessDeniedHandler.setErrorPage(accessDeniedUrl);
        return accessDeniedHandler(accessDeniedHandler);
    }
View Full Code Here

      consumerContextFilterBean.addPropertyReference("OAuthFailureHandler", failureHandlerRef);
    }
    else {
      String failurePage = element.getAttribute("oauth-failure-page");
      if (StringUtils.hasText(failurePage)) {
        AccessDeniedHandlerImpl failureHandler = new AccessDeniedHandlerImpl();
        failureHandler.setErrorPage(failurePage);
        consumerContextFilterBean.addPropertyValue("OAuthFailureHandler", failureHandler);
      }
    }

    String resourceDetailsRef = element.getAttribute("resource-details-service-ref");
View Full Code Here

     * @return the {@link ExceptionHandlingConfigurer} for further customization
     * @see AccessDeniedHandlerImpl
     * @see {@link #accessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler)}
     */
    public ExceptionHandlingConfigurer<H> accessDeniedPage(String accessDeniedUrl) {
        AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
        accessDeniedHandler.setErrorPage(accessDeniedUrl);
        return accessDeniedHandler(accessDeniedHandler);
    }
View Full Code Here

    // Attempt to determine a set of provider ids which are required for this request which the current user has not yet connected with
    Set<String> requiredProviderIds = getRequiredProviderIds(request);
    if (requiredProviderIds != null && !requiredProviderIds.isEmpty())
    {
      // If we have found a set of provider ids which the user needs to connect with for this request, select one of them and send the user to the connect/<provider> page
      AccessDeniedHandlerImpl providerSpecificAccessDeniedHandler
       = new AccessDeniedHandlerImpl();
      request.setAttribute(REQUIRED_PROVIDERS_REQUEST_ATTRIBUTE_NAME, requiredProviderIds);
      providerSpecificAccessDeniedHandler.setErrorPage(connectWithProviderUrlPrefix + "/" + requiredProviderIds.iterator().next());
      providerSpecificAccessDeniedHandler.handle(request, response, accessDeniedException);
    }
    else
    {
      if (defaultAccessDeniedUrl != null)
      {
        AccessDeniedHandlerImpl defaultAccessDeniedHandler
         = new AccessDeniedHandlerImpl();
        defaultAccessDeniedHandler.setErrorPage(defaultAccessDeniedUrl);
        defaultAccessDeniedHandler.handle(request, response, accessDeniedException);
       
      }
      else
      {
        super.handle(request, response, accessDeniedException);
View Full Code Here

        HttpSessionRequestCache cache = new HttpSessionRequestCache();
        cache.setCreateSessionAllowed(false);
        ExceptionTranslationFilter filter = new ExceptionTranslationFilter(ep,cache);
                               
        AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
       
        if (StringUtils.hasLength(authConfig.getAccessDeniedErrorPage())) {
            // check if page exists
            if (GeoServerExtensions.file(authConfig.getAccessDeniedErrorPage())!=null)
                accessDeniedHandler.setErrorPage(authConfig.getAccessDeniedErrorPage());
            else
                LOGGER.warning("Cannot find: "+ authConfig.getAccessDeniedErrorPage());
        }
           
        filter.setAccessDeniedHandler(accessDeniedHandler);
View Full Code Here

        return authenticationFilter;
    }

    @Bean
    public Filter exceptionTranslationFilter(RequestCache requestCache) {
        AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
        accessDeniedHandler.setErrorPage(applicationUrl("/access-denied"));
        LoginUrlAuthenticationEntryPoint authenticationEntryPoint = new LoginUrlAuthenticationEntryPoint(applicationUrl("/login"));
        ExceptionTranslationFilter exceptionTranslationFilter = new ExceptionTranslationFilter(authenticationEntryPoint, requestCache);
        exceptionTranslationFilter.setAccessDeniedHandler(accessDeniedHandler);
        return exceptionTranslationFilter;
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.access.AccessDeniedHandlerImpl

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.