Example usage for org.springframework.security.web.authentication Http403ForbiddenEntryPoint Http403ForbiddenEntryPoint

List of usage examples for org.springframework.security.web.authentication Http403ForbiddenEntryPoint Http403ForbiddenEntryPoint

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication Http403ForbiddenEntryPoint Http403ForbiddenEntryPoint.

Prototype

Http403ForbiddenEntryPoint

Source Link

Usage

From source file:com.springsource.html5expense.config.SecurityConfig.java

@Bean
public AuthenticationEntryPoint entryPoint() {
    return new Http403ForbiddenEntryPoint();
}

From source file:shiver.me.timbers.spring.security.integration.SpringSecurityConfiguration.java

@Override
protected final void configure(HttpSecurity http) throws Exception {
    http.antMatcher("/normal/**");
    http.csrf().disable();//from   w  w w .j a  v a  2s.  c  o  m
    http.authorizeRequests().anyRequest().authenticated();
    http.formLogin().successHandler(new NoRedirectAuthenticationSuccessHandler()).loginPage("/normal/signIn")
            .permitAll();
    http.logout().logoutUrl("/normal/signOut")
            .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler());
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint());
}

From source file:shiver.me.timbers.spring.security.integration.JwtCustomPrincipleSecurityConfigurationAnnotation.java

@Override
protected final void configure(HttpSecurity http) throws Exception {
    http.antMatcher("/custom/**");
    http.csrf().disable();//from w w w  . j a va 2  s.c  o  m
    http.authorizeRequests().anyRequest().authenticated();
    http.formLogin().successHandler(new NoRedirectAuthenticationSuccessHandler()).loginPage("/custom/signIn")
            .permitAll();
    http.logout().logoutUrl("/custom/signOut")
            .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler());
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint());
}

From source file:com.javiermoreno.springboot.rest.TokenSecurityAdapter.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
            .exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint()).and()
            // Filter order: http://docs.spring.io/spring-security/site/docs/3.2.0.RELEASE/apidocs/org/springframework/security/config/annotation/web/HttpSecurityBuilder.html#addFilter%28javax.servlet.Filter%29
            .addFilterAfter(authenticationTokenProcessingFilterBean(), BasicAuthenticationFilter.class)
            .authorizeRequests()/* ww w. ja  v a  2  s  . co m*/
            .antMatchers("/api-docs/**", "/public/**", "/views/**", "/errores/**", "/health/**", "/metrics/**",
                    "/configprops/**")
            .permitAll().antMatchers(HttpMethod.GET, "/private/**").hasRole("ADMIN")
            .antMatchers(HttpMethod.GET, "/shutdown/**").hasRole("ADMIN")
            //.access("hasRole('ROLE_ADMIN')")
            .anyRequest().authenticated().and().httpBasic();
}

From source file:shiver.me.timbers.spring.security.integration.StormpathAuthenticationConfiguration.java

@Override
protected final void configure(HttpSecurity http) throws Exception {
    http.antMatcher("/stormpath/**");
    http.csrf().disable();//w  w  w  . java  2 s  .c o m
    http.authorizeRequests().antMatchers("/stormpath/one").access("hasRole('ONE')")
            .antMatchers("/stormpath/two").access("hasRole('TWO')").anyRequest().authenticated();
    http.formLogin().successHandler(new NoRedirectAuthenticationSuccessHandler()).loginPage("/stormpath/signIn")
            .permitAll();
    http.logout().logoutUrl("/stormpath/signOut")
            .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler());
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint());
}

From source file:shiver.me.timbers.spring.security.integration.JwtCustomPrincipleSecurityConfigurationApply.java

@Override
protected final void configure(HttpSecurity http) throws Exception {
    http.apply(jwt());//from  w  w  w.j  a  v  a  2 s .  c  o m
    http.antMatcher("/custom/**");
    http.csrf().disable();
    http.authorizeRequests().anyRequest().authenticated();
    http.formLogin().successHandler(new NoRedirectAuthenticationSuccessHandler()).loginPage("/custom/signIn")
            .permitAll();
    http.logout().logoutUrl("/custom/signOut")
            .logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler());
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint());
}

From source file:shiver.me.timbers.spring.security.integration.AllAnnotationAuthenticationConfiguration.java

@Override
protected final void configure(HttpSecurity http) throws Exception {
    http.antMatcher("/all/**");
    http.csrf().disable();//  w  w  w  .j a  va  2s.c om
    http.authorizeRequests().antMatchers("/all/one").access("hasRole('ONE')").antMatchers("/all/two")
            .access("hasRole('TWO')").anyRequest().authenticated();
    http.formLogin().successHandler(new NoRedirectAuthenticationSuccessHandler()).loginPage("/all/signIn")
            .permitAll();
    http.logout().logoutUrl("/all/signOut").logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler());
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint());
}

From source file:shiver.me.timbers.spring.security.integration.AllApplyAuthenticationConfiguration.java

@Override
protected final void configure(HttpSecurity http) throws Exception {
    http.apply(jwt());/*from   ww w  .j a va 2s.c  o m*/
    http.antMatcher("/all/**");
    http.csrf().disable();
    http.authorizeRequests().antMatchers("/all/one").access("hasRole('ONE')").antMatchers("/all/two")
            .access("hasRole('TWO')").anyRequest().authenticated();
    http.formLogin().successHandler(new NoRedirectAuthenticationSuccessHandler()).loginPage("/all/signIn")
            .permitAll();
    http.logout().logoutUrl("/all/signOut").logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler());
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint());
}

From source file:business.security.HttpSecurityConfiguration.java

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.exceptionHandling().authenticationEntryPoint(new Http403ForbiddenEntryPoint()).and()
            .userDetailsService(userDetailsService()).formLogin().permitAll()
            .failureHandler(authenticationFailureHandler).and().logout().permitAll()
            .logoutSuccessUrl("/#/login").and().authorizeRequests().antMatchers("/admin/**")
            .access("hasRole('palga')").and().authorizeRequests()
            .antMatchers("/", "/robots.txt", "/public/labs/**", "/password/request-new", "/password/reset",
                    "/index.html", "/bower_components/**", "/app/**", "/js/**", "/messages/**", "/css/**",
                    "/*.ico", "/images/**")
            .permitAll().antMatchers(HttpMethod.POST, "/register/users").permitAll()
            .antMatchers(HttpMethod.POST, "/register/users/**").permitAll()
            .antMatchers(HttpMethod.GET, "/register/users/activate/**").permitAll()
            .antMatchers(HttpMethod.GET, "/status").permitAll().antMatchers(HttpMethod.GET, "/ping").permitAll()
            .anyRequest().authenticated().and().addFilterAfter(new CsrfHeaderFilter(), CsrfFilter.class).csrf()
            .csrfTokenRepository(csrfTokenRepository()).and().headers()
            .addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy-Report-Only",
                    "default-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:"));
}

From source file:com.sibvisions.rad.server.security.spring.SecurityManagerEntryPoint.java

/**
 * Creates a new instance of <code>SecurityManagerEntryPoint</code>.
 * /*from   w w w  .j av  a 2s .c o  m*/
 * @param pDelegateEntryPoint the delegate entry point
 */
public SecurityManagerEntryPoint(AuthenticationEntryPoint pDelegateEntryPoint) {
    delegateEntryPoint = pDelegateEntryPoint;
    delegateForbiddenEntryPoint = new Http403ForbiddenEntryPoint();
}