Attached my context provider for SAMLContextProviderLB bean
**<property name="scheme" value="https"/>**
<property name="serverName" value="${sp.hostname}"/>
<property name="serverPort" value="#{'${sp.ssl.port}'=='' ? 443 : '${sp.ssl.port}'}"/>
<property name="includeServerPortInRequestURL" value="#{'${sp.ssl.port}'=='443' ? false : true }"/>
<property name="contextPath" value="/${sp.context.root}"/>
I'm behind a reverse Proxy so I'm offloading the SSL Termination. the back-end server itself is listening on non-SSL but the webtier is terminating the SSL for us and forwarding to the non-ssl port. I've set up SAMLContextProviderLB with the above properties so that even tho the backend is https, it will know to map the intended recipient for the saml token as the https audience. What I'm seeing in the logs below however, when I go to a protected resource, its returning garbage on the browser. When I change it to https in the browser, it works as intended. Seeing the logs below shows that the value being return from DefaultSavedRequest url is HTTP when it should be HTTPs.
2016-03-07 18:24:11,907 INFO org.springframework.security.saml.log.SAMLDefaultLogger.log:127 - AuthNResponse;SUCCESS;10.4.203.88;https://myserver:89/fct;https://www.myADFS.com/adfs/services/trust;camachof@email.com;;
2016-03-07 18:24:11,909 DEBUG org.springframework.security.saml.SAMLProcessingFilter.successfulAuthentication:317 - Authentication success. Updating SecurityContextHolder to contain: org.springframework.security.providers.ExpiringUsernameAuthenticationToken@830e9237: Principal: camachof@email.com; Credentials: [PROTECTED]; Authenticated: true; Details: null; Not granted any authorities
2016-03-07 18:24:11,910 DEBUG org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler.onAuthenticationSuccess:79 - Redirecting to DefaultSavedRequest Url: http://myserver:89/fct/page
2016-03-07 18:24:11,911 DEBUG org.springframework.security.web.DefaultRedirectStrategy.sendRedirect:36 - Redirecting to 'http://myserver:89/fct/page'
2016-03-07 18:24:11,911 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository.saveContext:292 - SecurityContext stored to HttpSession: 'org.springframework.security.core.context.SecurityContextImpl@830e9237: Authentication: org.springframework.security.providers.ExpiringUsernameAuthenticationToken@830e9237: Principal: camachof@email.com; Credentials: [PROTECTED]; Authenticated: true; Details: null; Not granted any authorities'
2016-03-07 18:24:11,912 DEBUG org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter:97 - SecurityContextHolder now cleared, as request processing completed
Any ideas how to force this to HTTPS under this set up? Thanks in advance.