Implemented CROS header but access token is not verified due to OPTIONS as Method

In API proxy we always us to first verify the access token in PreFlow condition and then the actual call use to be made to API either GET or POST witjh backend.


But in my case, we have on API configured in Apigee which is GET call this run properly in RESTClient but when through Ajax code this is been hit, it gives CROS error i.e generate OPTIONS as a call from the browser. This is also handled at Apigee level using OptionPreFlight with help of below thread which works well.

" https://community.apigee.com/questions/2890/add-usable-cors-policy-in-my-api-proxy-when-using.html "

But now whenever a API is hit the Fault has to occur due to verifyAccessToken policy which is present in PreFlow condition How do I handle this in my API Proxy and if token is not verified the oAuth is not implemented then where do I add this policy.

Stuck over here any help would be Appreciated..!

@Anil Sagar @Dino @Maruti Chand @Barahalikar Siddharth

@JennyB and @mukundha@apigee.com

0 2 263
2 REPLIES 2

Thanks @Christin Brown..

Yes this works for me.