when add oauth to your project
oauth library create some endpoint for get token .get authorize code ,get refresh token and some other oauth protocol
this endpoint has rest url s in this url
Mapped "{[/oauth/authorize]}
Mapped "{[/oauth/token],methods=[GET]}"
Mapped "{[/oauth/check_token]}"
,..
when your project run in root servlet-path every thing is ok .but when using servlet-path:/api or other name
request to /api/oauth/token for get token is get exception
for solve this problem need to change default configuration for oauth path for change it nee write this configuration code
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.prefix("/api").authenticationManager(authenticationManager).userDetailsService(userDetailsService).
accessTokenConverter(jwtAccessTokenConverter());
}