@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .antMatchers(HttpMethod.POST).denyAll(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .httpBasic().and() .authorizeRequests() .anyRequest().denyAll(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .httpBasic().and() .authorizeRequests() .anyRequest().denyAll(); // @formatter:on }
@Override protected void configure(final HttpSecurity http) throws Exception { http .httpBasic().disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() .authorizeRequests() .antMatchers("/" + this.pathPrefix).permitAll() .antMatchers("/" + this.pathPrefix + "/ui/**").permitAll() .anyRequest().denyAll(); }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .exceptionHandling() .defaultAccessDeniedHandlerFor( this.teapotDeniedHandler, new AntPathRequestMatcher("/hello/**")) .defaultAccessDeniedHandlerFor( new AccessDeniedHandlerImpl(), AnyRequestMatcher.INSTANCE); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .exceptionHandling() .defaultAccessDeniedHandlerFor(new AccessDeniedHandlerImpl(), request -> false) .and() .httpBasic() .and() .oauth2ResourceServer() .jwt(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .exceptionHandling() .defaultAccessDeniedHandlerFor( this.teapotDeniedHandler, new AntPathRequestMatcher("/hello/**")); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .requestMatchers() .mvcMatchers("/path").servletPath("/spring") .mvcMatchers("/never-match") .and() .httpBasic().and() .authorizeRequests() .anyRequest().denyAll(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .antMatchers("/type").hasRole("ANON") .anyRequest().denyAll() .and() .anonymous() .authorities("ROLE_ANON"); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .httpBasic().and() .authorizeRequests() .mvcMatchers("/path").servletPath("/spring").denyAll(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .antMatchers("/key").anonymous() .anyRequest().denyAll() .and() .anonymous().key("AnonymousKeyConfig"); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .requestMatchers(new AntPathRequestMatcher("/user/{user}", null, false)).access("#user == 'user'") .anyRequest().denyAll(); // @formatter:on }
protected void configure(HttpSecurity http) throws Exception { http .requestMatchers() .antMatchers("/never/") .antMatchers(HttpMethod.POST, new String[0]) .and() .authorizeRequests() .anyRequest().denyAll(); }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .antMatchers("/principal").anonymous() .anyRequest().denyAll() .and() .anonymous().principal("AnonymousUsernameConfig"); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .antMatchers("/type").anonymous() .anyRequest().denyAll(); // @formatter:on } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .requestMatchers(new AntPathRequestMatcher("/user/{userName}", null, false)).access("#userName == 'user'") .anyRequest().denyAll(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .mvcMatcher("/path") .httpBasic().and() .authorizeRequests() .anyRequest().denyAll(); // @formatter:on }
protected void configure(HttpSecurity http) throws Exception { http .requestMatchers() .antMatchers(HttpMethod.POST) .and() .authorizeRequests() .anyRequest().denyAll(); }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .requestMatchers() .mvcMatchers("/path") .and() .httpBasic().and() .authorizeRequests() .anyRequest().denyAll(); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().denyAll() .and() .oauth2ResourceServer() .accessDeniedHandler(accessDeniedHandler()) .jwt(); // @formatter:on }