Nativefier: Can't login with google oauth

Created on 22 Dec 2018  路  6Comments  路  Source: jiahaog/nativefier

Description

I can't log in to a created application with as a google user

Steps to reproduce issue

1) Make an app from the pomodoro tracker site
2) Try to log in as a google user; the app will transfer me to the actual chrome at this step; if I select my account - it will show error 403: Invalid token "".; meanwhile the created application doesn't respond

Details

  • Are you nativefying a public website? - Yes
  • Feature request? Have you looked at nativefier --help to see if an existing option could fit your needs? - Not applicable
  • Full nativefier command used to build your app: nativefier https://pomodoro-tracker.com/
  • Version of Nativefier (run nativefier --version): v7.6.9
  • Version of node.js (run node --version): v11.4.0
  • OS: Mac OS 10.14.2
  • Error message / stack trace (if any):
403: Invalid token "".

Most helpful comment

For me just adding the main domain again to the internal urls (in addition to the Google authentication domain accounts.google.com) did the trick.

Example for https://next.focuster.com which uses Google OAuth for login:

nativefier --name "Focuster" "https://next.focuster.com" --internal-urls "accounts.google.com|next.focuster.com"

Note: it will not always be the main domain, that you need to add to internal URLs. If it doesn't work:

  1. Pull up developer tools in your browser
  2. Make sure to "preserve logs" in the network tab (see https://stackoverflow.com/a/12282621/304266)
  3. Run through the auth flow in your browser
  4. Add all domains in the flow (including redirects, that's why we initially chose to preserve the logs) into internal URLs. Domain changes are highlighted in blue in the request list.

That should work for most auth implementations.

All 6 comments

A similar issue is with To do from microsoft. If you try to sign in - it will just show loading and redirect you to the browser

Similar issue at #745.

For me just adding the main domain again to the internal urls (in addition to the Google authentication domain accounts.google.com) did the trick.

Example for https://next.focuster.com which uses Google OAuth for login:

nativefier --name "Focuster" "https://next.focuster.com" --internal-urls "accounts.google.com|next.focuster.com"

Note: it will not always be the main domain, that you need to add to internal URLs. If it doesn't work:

  1. Pull up developer tools in your browser
  2. Make sure to "preserve logs" in the network tab (see https://stackoverflow.com/a/12282621/304266)
  3. Run through the auth flow in your browser
  4. Add all domains in the flow (including redirects, that's why we initially chose to preserve the logs) into internal URLs. Domain changes are highlighted in blue in the request list.

That should work for most auth implementations.

Thank you @ubuntudroid, this solution saved me.

For anyone trying to add Jira (without access to a Jira account with Google login) a slightly modified version of the code above worked for me:

nativefier --name "Jira" "https://safetysync.atlassian.net" --internal-urls "id.atlassian.com/login|safetysync.atlassian.net"

This will let you login with email/password without booting you to a browser window which displays an error.

If you're authentication using Microsoft AD then you need to add login.microsoftonline.com to internal urls.

Looks like --internal-urls is doing the trick. Closing to centralize discussion around https://github.com/jiahaog/nativefier/issues/706#issuecomment-602057644 , PR welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamiewilson picture jamiewilson  路  5Comments

jjgalvez picture jjgalvez  路  3Comments

luco picture luco  路  4Comments

theman8631 picture theman8631  路  5Comments

danielyli picture danielyli  路  5Comments