oauth - How do I get around Access-Control-Allow-Origin error with ReactJS? -
i have flask backend set runs through google's oauth2 flow. when user visits /signup, there's button there can press start up. know flow works because if set start visits /signup (by doing 302 redirect /start-google-oauth endpoint), goes smoothly.
but if remove redirect , have user start flow pressing button, doesn't work. button issues request /start-google-oauth redirect google open popup window returns access-control-allow-origin error:
xmlhttprequest cannot load https://accounts.google.com/o/oauth2/auth?redirect_uri=... no 'access-control-allow-origin' header present on requested resource. origin '<origin url>' therefore not allowed access.
the origin specified origin url given valid redirect_uri in app's credential setup.
what causing this?
since forwarding get
request try setting access-control-allow-origin: *
before forwarding.
Comments
Post a Comment