I’ve try to deploy spring boot application with spring security in latest wildfly version. But if i try to call POST method return 405 error ("HTTP method POST is not supported by this URL").
This is my WebSecurityConfig
Customizer<LogoutConfigurer<HttpSecurity>> logoutConfigurerCustomizer = httpSecurityLogoutConfigurer -> {
httpSecurityLogoutConfigurer.deleteCookies("JSESSIONID");
httpSecurityLogoutConfigurer.permitAll();
};
Customizer<SessionManagementConfigurer<HttpSecurity>> sessionManagementConfigurerCustomizer =
httpSecuritySessionManagementConfigurer ->
httpSecuritySessionManagementConfigurer.maximumSessions(1);
http
.csrf(AbstractHttpConfigurer::disable)
.exceptionHandling(exception -> exception.authenticationEntryPoint(unauthorizedHandler))
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth ->
auth.requestMatchers("/prog/auth/**").permitAll()
.requestMatchers("/prog/url/**").hasAnyAuthority("AUTH1","AUTH2")
My Controller:
@RestController
@RequestMapping("/auth")
public class AuthController {
I’ve also jboss-web.xml with context root "/prog" and plugin in pom.xml:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>5.0.0.Final</version>
</plugin>
When i deploy application in wildfly then run :
http://localhost:8080/prog/auth/signin (POST method)
The error is HTTP method POST is not supported by this URL
You need to sign in to view this answers