If you are using Spring Boot, you can choose Oauth2 Authorization Server from the https://start.spring.io/ instead of importing org.springframework.security:spring-security-oauth2-authorization-server ...