@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests().anyRequest().authenticated() .and() .csrf().disable(); // @formatter:on }
@Override public void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/" , "/demo").permitAll() .anyRequest().authenticated(); } }
@Override protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http .authorizeRequests() .antMatchers("/actuator/**").permitAll() .anyRequest().authenticated() .and() .httpBasic() ; } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .and() .formLogin(); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/users**", "/sessions/**").hasRole("USER") .antMatchers("/signup").permitAll() .anyRequest().hasRole("USER"); }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().anonymous() .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.NEVER); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().permitAll() .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.STATELESS); } }
@Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().permitAll() .and() .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.ALWAYS); } }
@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 { // @formatter:off http .authorizeRequests() .anyRequest().authenticated() .and() .oauth2Login(); // @formatter:on } }
@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(); }
protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().hasRole("USER") .and() .httpBasic(); } }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().authenticated() .and() .oauth2ResourceServer() .jwt() .decoder(decoder()); // @formatter:on }
@Override protected void configure(HttpSecurity http) throws Exception { // @formatter:off http .authorizeRequests() .anyRequest().authenticated() .and() .oauth2ResourceServer(); // @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 } }
protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .regexMatchers(".*").permitAll(); } }
protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .anyRequest().authenticated() .antMatchers("/demo/**").permitAll(); } }
@Override public void configure(HttpSecurity http) throws Exception { http.authorizeRequests().anyRequest().access("#oauth2.hasScope('trust')"); } }));
@Override public void configure(HttpSecurity http) throws Exception { // @formatter:off http // Just for laughs, apply OAuth protection to only 3 resources .requestMatchers().antMatchers("/","/admin/beans","/admin/health") .and() .authorizeRequests() .anyRequest().access("#oauth2.hasScope('read')"); // @formatter:on }