Google Oauth issues

I have a dashboard running on raspberry pi
running on diet-pi
pi running just Node-red and chromium in kiosk mode locally so it's not accessible from outside world
I have alot of widgets running on dashboard getting data from apis like behance api
I tried alot of things to reach my google analytics data from this setup but I can't get it work without exposing raspberry pi to outside world.
I tried this nodes but I cannot find a working solution.
node-red-contrib-google-oauth2
@alpine-code/node-red-contrib-google

So I need some advice about this situation.
:v:

Which analytics API are you trying to use that requires the pi to be exposed to the internet?

google Analytics and analytics realtime api

Why does that require you to open up the pi to the internet?

like this one
while making configuration
like this

Configuration

  1. Generate OAuth credentials at Google API Console.
  • Choose Web Application.
  • As Authorized JavaScript origins enter your Node-RED IP ( e.g. http://localhost:1880 )
  • As Authorized redirect URIs enter your Node-RED IP plus /google-credentials/auth/callback ( e.g. http://localhost:1880/google-credentials/auth/callback )
  1. Copy the Client ID and Client secret and paste them into the Config Node

I cannot enter My ip its not localhost its 192.168.1.46 the ip of my pi and its only accessible from local network

Oh, do you mean that the pi needs to be able to access the internet, which it can't? That isn't the same thing as 'exposing the pi to the outside world' which would generally means that the pi would be accessible from the internet.

How are you intending to access the analytics API if you can't access the internet?

pi can access internet but ip is only local
by exposing I mean my node-red instance only accesible from local network for the dashboard use only
I dont have any reverse proxy or something to access pi from outside
so I cant make Oauth working :confused:

OK, taking a step back,

Why is not localhost correct? The instructions you posted are for configuring the OAuth node in node red, which presumably in your case is running on the pi, and when on the pi localhost is the correct ip for where node-red is running.

I cant even write localhost because google wants a top level domain like examle.com
Screen Shot 2021-03-08 at 18.47.46
I guess I need to find another way :confused:

The instructions say to enter that at Authorised Javascript Origins, not Authorised domains. Maybe you are selecting the wrong application type, it should be Web App I think.

I tried it already :confused:
now I'm trying to implemet this shell - curl script with http nodes

So what are we supposed to do with that information if you don't tell us what the problem then was?

Actually the problem was dietpi :slight_smile:
Now I have a fresh install raspberry pi running all my nodes without dietpi
I'll update here if I can come up with a solution for google api
now I can run this without problems

[{"id":"a7d4e707.fd8a18","type":"inject","z":"d7276cd2.d6f55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":240,"wires":[["97c92fce.dd6f6"]]},{"id":"97c92fce.dd6f6","type":"template","z":"d7276cd2.d6f55","name":"","field":"payload","fieldType":"msg","format":"python","syntax":"plain","template":"import time\n\nwhile True:\n    print(time.ctime())\n    time.sleep(10)\n","output":"str","x":320,"y":240,"wires":[["1273e63.74b5c1a"]]},{"id":"1273e63.74b5c1a","type":"file","z":"d7276cd2.d6f55","name":"","filename":"pythontest.py","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":510,"y":240,"wires":[["14057906.c24237"]]},{"id":"14057906.c24237","type":"exec","z":"d7276cd2.d6f55","command":"python pythontest.py","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"","x":740,"y":240,"wires":[["a33c536c.9900e"],[],[]]},{"id":"a33c536c.9900e","type":"debug","z":"d7276cd2.d6f55","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":240,"wires":[]},{"id":"30c2f0a3.23d67","type":"inject","z":"d7276cd2.d6f55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":340,"wires":[["6f55d101.6d98f"]]},{"id":"6f55d101.6d98f","type":"template","z":"d7276cd2.d6f55","name":"","field":"payload","fieldType":"msg","format":"python","syntax":"plain","template":"console.log(\"Hello World\");","output":"str","x":320,"y":340,"wires":[["cdbed88d.d58b98"]]},{"id":"cdbed88d.d58b98","type":"file","z":"d7276cd2.d6f55","name":"","filename":"test.js","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":480,"y":340,"wires":[["de5b2d6d.8b00f8"]]},{"id":"de5b2d6d.8b00f8","type":"exec","z":"d7276cd2.d6f55","command":"node test.js","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"","x":710,"y":340,"wires":[["c7792da8.272e58"],[],[]]},{"id":"c7792da8.272e58","type":"debug","z":"d7276cd2.d6f55","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":340,"wires":[]}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.