Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node webkit and Google OAuth

Just starting out with node webkit and I'm simply loading a website through an iframe to start...(I know, dirty but gets the job done with 2 hands and a bit of time).

<iframe src="http://somewebsite.com"></iframe>

The thing is, I have Google login for the site, which creates a pop up on the website. For some reason, it doesn't in node-webkit and I can't find any doc about enabling popups...

The code I'm using for the Google login is the default one they give us on the site: https://developers.google.com/accounts/docs/OAuth2Login

I'm currently not setting anything exciting in the node-webkit configuration:

"window": {
    "toolbar": true,
    "width": 1024,
    "height": 768,
    "min_width": 300,
    "min_height": 300,
    "position": "center",
    "resizable": true,
    "show_in_taskbar": true,
    "icon": "www/resources/img/icon.png"
},

So my question is, how can I enable popups on node-webkit from an iframe to get the Google OAuth working? Thanks in advance for your help.

like image 678
denislexic Avatar asked Oct 31 '22 18:10

denislexic


1 Answers

I had the same issue and managed to fix it by authorizing the node context to remote sites.

Simply add the node-remote configuration item to your package.json file. (But be warned that this can cause some libraries to load differently as they will detect the change in context).

{
    node-remote : "*" // Or the src url of your iframe
}

Google login should be working fine after that.

like image 53
Guillaume Acard Avatar answered Nov 12 '22 16:11

Guillaume Acard