I have one spring boot app which contains spring security with formLogin being added and custom loginPage . Whenever I get authenticated then it will send me to the defaultSuccessUrl which is /app/dashboard and it sends with the schema http I been trying all day to just make the successUrl schema to be https just tweaking some changes on application.properties and sometimes with Bean but i am still not able to make it happen. My application is in cloudfoundry which and i don't have 80 port but only 443(https) .
My configuration in spring is like this :
http
.authorizeRequests()
.antMatchers("/", "/forbidden", "/index.html", "/webjars/*", "/app.js", "/access/*", "/signup", "/l10n/*.js", "/", "/tpl/**/*.html", "/fonts/**/*.woff").permitAll()
.anyRequest().authenticated()
.and().addFilterAfter(new CsrfHeaderFilter(), CsrfFilter.class).
csrf().csrfTokenRepository(repo)
.and() .httpBasic().disable()
.formLogin()
.loginPage("/access/signin").permitAll()
.failureUrl("/error")
.defaultSuccessUrl("/app/dashboard")
.and().logout()
.logoutRequestMatcher(new AntPathRequestMatcher("access/logout"))
.logoutSuccessUrl("/access/signin").permitAll();
I did also tried to use absolute url with https but it is not working good.
`Starting ProtocolHandler ["http-nio-64143"]` `Using a shared selector for servlet write/read` `Tomcat started on port(s): 64143 (http)` `Updating port to 64143` That means cloudfoundry is mapping https to **64143** port. – privatejava Dec 13 '16 at 10:58