vdenotaris / spring-boot-security-saml-sample

SBS3 — A sample SAML 2.0 Service Provider built on Spring Boot.
https://sbs3.vdenotaris.com
Apache License 2.0
562 stars 351 forks source link

Configure application for proxy Settings #63

Closed rscully closed 4 years ago

rscully commented 5 years ago

It might be good to include the ability to configure proxy settings in this application. I had to add following configuration to WebSecurityConfig httpClient bean to get this to work behind a proxy but it took a couple hours pain to find the problem followed by the solution

    @Bean
    public HttpClient httpClient() {
        HttpClient client = new HttpClient(this.multiThreadedHttpConnectionManager);
        HostConfiguration hostConfiguration = new HostConfiguration();
        hostConfiguration.setProxy("PROXYHOST", PROXYPORT);
        client.setHostConfiguration(hostConfiguration);
        return client;
    }

It is also not be possible to use the docker image behind a proxy as it stands. This could be provided as environment params to the docker container.

The update.sh script does not appear to work work from gitbash and idp certificate needs to be imported manually.

Also, to configure maven proxy settings on image a new container is required as it stands, see my sample Dockerfile here:

FROM vdenotaris/spring-saml-sp:1.8.0-mvn-jdk8 COPY settings.xml /root/.m2/

Thanks, Rob.