# Google Oauth issues

**URL:** <https://discourse.nodered.org/t/google-oauth-issues/42197>\
**Category:** General\
**Created:** [7 March 2021 12:29 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197 "2021-03-07T12:29:33Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [7 March 2021 12:29 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/1 "2021-03-07T12:29:33Z")

</div>

I have a dashboard running on raspberry pi  
running on [diet-pi](https://dietpi.com/)  
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](https://flows.nodered.org/node/node-red-contrib-google-oauth2)  
[@alpine-code/node-red-contrib-google](https://flows.nodered.org/node/@alpine-code/node-red-contrib-google)

So I need some advice about this situation.  
✌

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 March 2021 15:07 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/2 "2021-03-07T15:07:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [7 March 2021 15:14 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/3 "2021-03-07T15:14:21Z")

</div>

google Analytics and analytics realtime api

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 March 2021 15:50 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/4 "2021-03-07T15:50:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [7 March 2021 19:01 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/5 "2021-03-07T19:01:17Z")

</div>

[like this one](https://flows.nodered.org/node/node-red-contrib-google-oauth2)  
while making configuration  
like this

## Configuration

1. Generate OAuth credentials at [Google API Console](https://console.developers.google.com/apis/credentials/oauthclient).

- 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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 March 2021 20:31 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/6 "2021-03-07T20:31:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [8 March 2021 12:45 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/7 "2021-03-08T12:45:15Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 March 2021 13:58 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/8 "2021-03-08T13:58:04Z")

</div>

OK, taking a step back,

> [@umtksa](#):
>
> I cannot enter My ip its not localhost its 192.168.1.46

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.

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [8 March 2021 15:52 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/9 "2021-03-08T15:52:16Z")

</div>

I cant even write localhost because google wants a top level domain like [examle.com](http://examle.com)  
 ![Screen Shot 2021-03-08 at 18.47.46](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/9/09bac7174d7afee88d25381562a9a2388343bddd.png)  
I guess I need to find another way 😕

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 March 2021 16:10 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/10 "2021-03-08T16:10:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [8 March 2021 23:21 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/11 "2021-03-08T23:21:57Z")

</div>

I tried it already 😕  
now I'm trying to implemet [this shell - curl script](https://gist.github.com/eruffaldi/98cfb6cc5b11a3778ac9dcb507ac75f4) with http nodes

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 March 2021 09:14 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/12 "2021-03-09T09:14:00Z")

</div>

> [@umtksa](#):
>
> I tried it already

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

---

<div class="post-metadata">

**Author:** ![umtksa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/umtksa/32/38322_2.png) [@umtksa](https://discourse.nodered.org/u/umtksa)\
**Post date:** [10 March 2021 12:14 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/13 "2021-03-10T12:14:20Z")

</div>

Actually the problem was dietpi 🙂  
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

```auto
[{"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":[]}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 May 2021 12:15 UTC](https://discourse.nodered.org/t/google-oauth-issues/42197/14 "2021-05-09T12:15:06Z")

</div>

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