Spring Security: disable https for some urls -
i have 3 maven modules:
- "controller a" - spring boot web app, "/a/*" urls
- "controller b" - spring boot web app, "/b/*" urls
- "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
Post a Comment