BookStoreApp-Distributed-Application icon indicating copy to clipboard operation
BookStoreApp-Distributed-Application copied to clipboard

Cors is not handled

Open Mohitrajranu opened this issue 4 years ago • 1 comments

When submitting request from frontend , cors issue is getting triggered although it can be resolved if in the ResourceServerConfig.java you can add Cors configurationSource bean and in http.cors() and also in the api gateway class add CorsFilter class and annotate it as @component. After doing this for catalog product service we no longer get cors policy issue but the same code is not working when we call signup service as we get error Request header field authorization is not allowed by Access-Control-Allow-Headers , although we have added the said Authorization headers in cors configuration , but when account/oauth/token api is called at time of registering user we get the error

Mohitrajranu avatar Jul 21 '21 14:07 Mohitrajranu

Was able to solve the cors issue after handing the oauth token implementation to handle Options Method type in Authorization server config class

Mohitrajranu avatar Jul 21 '21 17:07 Mohitrajranu