Spring Security: disable https for some urls -


i have 3 maven modules:

  1. "controller a" - spring boot web app, "/a/*" urls
  2. "controller b" - spring boot web app, "/b/*" urls
  3. "common" - shared spring security configuration

and want "/a/" use https , x509 , "/b/" use http without security (or kind of security - jwt example).

my current version is:

public class securityconfig extends websecurityconfigureradapter {      @override     protected void configure(httpsecurity http) throws exception {         http.authorizerequests()                 .antmatchers("/a/**").authenticated()                 .and()                 .x509()                 .and().csrf().disable();     }      @override     public void configure(websecurity web) throws exception {         web.ignoring().antmatchers("/b/**");     } } 

it still runs b on https , required auth. possible configure want without creating separate security configuration?

when using http , https, have configure 2 connectors. stated in documentation (see http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-configure-ssl), not possible using config file only.

you have configure 1 of connectors (e.g. https) , add other programmatically. example shows how: https://github.com/spring-projects/spring-boot/tree/v1.3.6.release/spring-boot-samples/spring-boot-sample-tomcat-multi-connectors

by way, not recommended use plain http anymore.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -