GithubHelp home page GithubHelp logo

Comments (14)

knolleary avatar knolleary commented on July 21, 2024

Having you followed the second part of the instructions:

Please configure the authorized Redirect URIs of your app to include the following url:
http://node-red-example.com/google-credentials/auth/callback
You will need to edit your hosts file and add an entry for node-red-example.com that points to the actual IP address of your Raspberry Pi.

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

Yes i did, because without that, google says that the redirect URI does not match any registered redirect URI

from node-red-web-nodes.

knolleary avatar knolleary commented on July 21, 2024

As well as the bit about editing your hosts file?

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

Yes, I created an entry in /etc/hosts first, that associates the name "node-red.example.com" to my Raspberry IP

from node-red-web-nodes.

knolleary avatar knolleary commented on July 21, 2024

So if you made that entry, can you browse to http://node-red.example.com:1880 to see the node-red UI?

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

No, i cannot (browser error code : 105), because i access to node-RED on my raspberry by the use of a computer, and the computer only get access to node RED ui with raspberry_IP:1880 or Raspberry_hostname:1880, but only the Raspberry knows what node-red.example.com means, I think that is the reason of the issue

from node-red-web-nodes.

knolleary avatar knolleary commented on July 21, 2024

Yes. You need to edit the hosts file of the computer you are accessing node-red from - as that is the computer that needs to be able to resolve the address.

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

Thanks but this solution does not please me that much, because I will need to repeat this step each time I access it from a new computer, and it isn't viable for what I wanna do...

I found an alternative, i am currently trying to authenticate this way :

https://developers.google.com/accounts/docs/OAuth2InstalledApp#choosingredirecturi

from node-red-web-nodes.

knolleary avatar knolleary commented on July 21, 2024

You only need to do this once to complete the authentication process.

@hindessm any comments?

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

Once for each computer that provide my Node-RED access, am I wrong ?

from node-red-web-nodes.

knolleary avatar knolleary commented on July 21, 2024

It depends what exactly you are trying to do.

The authentication flow is needed to give Node-RED the necessary access tokens to talk to the google api. You need to set that up once for your flow. So you only need to the host setup on the computer from which you access Node-RED when you are setting up the google node.

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

In fact, I try to change this node configuration, my goal is to make the oauth as simple as in the node RED core Twitter Node.

As I imagine this, i get the node, i open config and I click on a authenticate with google button (with google client secret and id already registered in the code) , and it works. But I don't think something as simple is possible if the only solution we have is to configure the computer host in order to make it work...

from node-red-web-nodes.

knolleary avatar knolleary commented on July 21, 2024

The twitter api does not restrict the url you redirect the browser to after authentication; you can specify it as part of the auth flow. This allows us to set a redirect_url dynamically that will work regardless of where node-red is installed and how you are accessing it.

With the google api (as well as foursquare/swarm and a number of others), you have to provide the redirect_url as part of the app configuration andyou must use that redirect_url as part of the flow.
We cannot pre-register an app with these apis with a redirect_uri that will Just Work for everyone.

Some of these APIs also explicitly forbid us from registering an app that everyone then uses - they require each user to register their own app.

from node-red-web-nodes.

fabien14840 avatar fabien14840 commented on July 21, 2024

But the issue remains, even with your version of the node, so do you think my redirection trouble's unique solution is to configure the computer hosts ? I'll keep searching about the link I mentioned earlier, to see if it solves it.

from node-red-web-nodes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.