At firstly, check the Official Guide https://github.com/spring-projects/spring-security/wiki/OAuth-2.0-Migration-Guide