#How to redirect to https in spring boot web flux (netty server)?

3 messages · Page 1 of 1 (latest)

river haven
#

This is from spring docs. I added this code and it does redirect to https. But when trying to log in (send a post request) from inside frontend, it can not find expected header 'csrf token' (this was working correctly before adding redirect code).

@Bean
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
    http
        // ...
        .redirectToHttps(withDefaults());
    return http.build();
}
visual hillBOT
#

This post has been reserved for your question.

Hey @river haven! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.