ulisesbocchio / spring-boot-security-saml

spring-security-saml integration with Spring Boot
MIT License
158 stars 73 forks source link

Force HTTPS schema in generate metadata #95

Closed JuMp3 closed 3 years ago

JuMp3 commented 3 years ago

Is it possible "to force" the hostname schema when generating metadata? I noticed that when the application is released in an environment where certificates have been configured, and you try to generate the metadata file, the file is generated with the hostname schema in HTTP, even if the call was made in HTTPS (example https://my-hostname.it/context-root/saml/metadata).

Thanks for your time.

ulisesbocchio commented 3 years ago

Yes. https://github.com/ulisesbocchio/spring-boot-security-saml#configure-your-application-behind-a-load-balancer

JuMp3 commented 3 years ago

Hi Ulises, I tried following the load balancer setup, but didn't get what I wanted. I solved it by simply setting the entityBaseURL in the metadataGenerator configuration:

.and() .metadataGenerator() .entityId("MY-ENTITY-ID") .entityBaseURL("https://my-hostname.it/context-root")

Thanks for your support!