protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().hasRole("USER") .and() .httpBasic(); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/*").hasRole("USER") .and() .formLogin(); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .requestMatchers() .antMatchers("/api/**") .antMatchers("/oauth/**") .and() .authorizeRequests() .antMatchers("/**").hasRole("USER") .and() .httpBasic(); } }
@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 { http .authorizeRequests() .expressionHandler(expressionHandler()) .antMatchers("/admin/**").hasRole("ADMIN") .antMatchers("/user/**").hasRole("USER") .antMatchers("/allow/**").access("check('user')") .anyRequest().access("check('admin')"); } // @formatter:on
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/signup", "/about").permitAll() .anyRequest().hasRole("USER") .and() .formLogin() .loginPage("/login") .permitAll(); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .antMatcher("/role3/**") .authorizeRequests() .anyRequest().hasRole("3"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .antMatcher("/role1/**") .authorizeRequests() .anyRequest().hasRole("1"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().hasRole("4"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .antMatcher("/role1/**") .authorizeRequests() .anyRequest().hasRole("1"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().hasRole("USER") .and() .httpBasic() .authenticationEntryPoint(this.authenticationEntryPoint); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().hasRole("USER") .and() .httpBasic().realmName("Custom Realm"); } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().hasRole("ADMIN"); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/admin").hasRole("ADMIN") .anyRequest().authenticated() .and() .exceptionHandling() .accessDeniedPage("/AccessDeniedPage"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .antMatcher("/role2/**") .authorizeRequests() .anyRequest().hasRole("2"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/admin/**").hasRole("ADMIN") .antMatchers("/user/**").hasRole("USER") .antMatchers("/allow/**").access("@permission.check(authentication,'user')") .anyRequest().access("@permission.check(authentication,'admin')"); } // @formatter:on
@Override protected void configure(HttpSecurity http) throws Exception { http .antMatcher("/role2/**") .authorizeRequests() .anyRequest().hasRole("2"); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/signup", "/about").permitAll() .anyRequest().hasRole("USER") .and() .formLogin() .loginPage("/login") // set permitAll for all URLs associated with Form Login .permitAll(); }