-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirection trouble with raspberry pi #118
Comments
Having you followed the second part of the instructions:
|
Yes i did, because without that, google says that the redirect URI does not match any registered redirect URI |
As well as the bit about editing your hosts file? |
Yes, I created an entry in /etc/hosts first, that associates the name "node-red.example.com" to my Raspberry IP |
So if you made that entry, can you browse to http://node-red.example.com:1880 to see the node-red UI? |
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 |
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. |
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 |
You only need to do this once to complete the authentication process. @hindessm any comments? |
Once for each computer that provide my Node-RED access, am I wrong ? |
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. |
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... |
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. 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. |
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. |
HI all,
Here's my trouble,
I'm using the google calendar node on a raspberry pi (I access it via a computer). I wrote an entry in hosts, created an app with the right redirect URI ("node-red-example.com").
But when I try to authenticate with google, after having accepted the permissions, the redirection to the page "Authorised - you can close this window and return to Node-RED" fails (web browser returns a 105 error code), I think it is because the DNS does not know the "node-red-example.com" domain...
It only works if i replace manually the "node-red-example.com" with my raspberry IP in the failing URL, do you have any solution to provide having to do it by myself each time ?
The text was updated successfully, but these errors were encountered: