MomenSherif / react-oauth

Google OAuth2 using the new Google Identity Services SDK for React 🚀
https://www.npmjs.com/package/@react-oauth/google
MIT License
1.13k stars 141 forks source link

Cross-Origin-Opener-Policy policy would block the window.postMessage call. #301

Open Luna-omni opened 1 year ago

Luna-omni commented 1 year ago


Hello, first of all, thank you for your amazing library. I have a question. When I click to authorize a user, I encountered the following messages.

Cross-Origin-Opener-Policy policy would block the window.postMessage call. client:275 Cross-Origin-Opener-Policy policy would block the window.closed call.

I googled it and added the code below to my index.html, but it did not work.

<meta http-equiv="Content-Security-Policy" content="frame-src https://accounts.google.com/gsi/;" />

Could you help me?

appyit3 commented 1 year ago

+1

ali-faiz-brainx commented 1 year ago

+1

Anas-hmeed commented 1 year ago

+1

nch3ng commented 1 year ago

+1

Emeruem-Kennedy1 commented 1 year ago

+1

MomenSherif commented 1 year ago

Add section in the docs related to google's guide for CSP, you can check

nilscam commented 1 year ago

+1

mgoldenbe commented 10 months ago

So, has anyone figured out what exactly we need to do to get rid of the error message in the Console when testing at localhost:3000?

Lenur29 commented 10 months ago

@Luna-omni @mgoldenbe @nilscam @appyit3 Has anybody found the solution? If yes, please help me

sbhatm1213 commented 1 month ago

Cross-Origin-Opener-Policy policy would block the window.postMessage call.

I have added my domain in Authorized Javascript Origins I have added my domain in Authorized Redirect URIs I tried setting ux_mode="redirect" in the GoogleLogin cmponent I tried setting login_uri=<my-window-domain> in the GoogleLogin component

Nothing works I tried all of the above on local aswell as vercel hosted env Nothing seems to solve the issue