javascript Instagram login Access-Control-Allow-Origin Error
javascript Instagram login Access-Control-Allow-Origin Error
I follow the step for client login on Instagram, I configured my app on instagram client manager
My webapp follows this steps:
I change url in https://api.instagram.com/oauth/authorize/?client_id=<MY_CLIEND_ID>&redirect_uri=http://localhost:8080/&response_type=code
https://api.instagram.com/oauth/authorize/?client_id=<MY_CLIEND_ID>&redirect_uri=http://localhost:8080/&response_type=code
I authorize my webapp
The url become http://localhost:8080/?code=<INSTAGRAM_ACCESS_TOKEN>
http://localhost:8080/?code=<INSTAGRAM_ACCESS_TOKEN>
I call ( Ajax GET request ) https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=<INSTAGRAM_ACCESS_TOKEN>
https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=<INSTAGRAM_ACCESS_TOKEN>
But i get this error:
Failed to load https://api.instagram.com/v1/tags/nofilter/media/recent?access_token=INSTAGRAM_ACCESS_TOKEN : Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.
1 Answer
1
Try calling the same Ajax using CORSA API, prefix “https://cors-anywhere.herokuapp.com/“ + URL, adding CORSA should bypass CORS easily. :)
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.