I would like to add custom headers to Oauth2 token response for my spring application. Specifically it involves CORS headers i.e. Access-Control-Allow-Origin... I have managed to add them to 401 responses but have no luck with 200 ones.
I have looked everywhere and debugged the project with no result. I have tried adding those headers through interceptor but response still does not contain them. Any ideas?
I'm using Spring security with annotation configuration.
I have asked similar question here: Allow OPTIONS HTTP Method for oauth/token request where you can check my spring configuration.