Open Balbao opened 3 years ago
Same here. I also had to import my client ID and Secret by hand, It would not take them out of the pop-up box.
WFM. Hopefully your pasted json starts like {"installed":{"client_id"
?
If you didn't make the right type of oauth credentials ("TV"), your json might start with something else like {"web":
which won't work.
Does not work for me either. Import works (redirectUri shows as urn:ietf:wg:oauth:2.0:oob
? also tried the other one http://localhost
), but nothing happens when clicking 'open Google authentication').
Reason: browser console shows there's a 404 when trying to open:
https://MYSERVER/google-credentials/authUrl/MYSECRET/MYCLIENTID/urn:ietf:wg:oauth:2.0:oob
Credentials type is TV client. Using Node Red inside Home Assistant.
JSON contents:
{
"installed": {
"client_id": "MYCLIENTID",
"project_id": "MYPROJECT",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "MYSECRET",
"redirect_uris": [
"urn:ietf:wg:oauth:2.0:oob",
"http://localhost"
]
}
}
Wivaku I had the same problem, but solved it by performing the additional step of enabling the Calendar API by visiting: https://console.cloud.google.com/apis/api/calendar-json.googleapis.com/overview?project={project name}
Calendar API was already enabled.
Home Assistant's Google Calendar Event component uses the same project without issues.
Thanks for the contributed nodes. Sadly, I have the same problem with the Open Google Authentication button not opening a window. Up to this point was fine (once I realised a TV-style credential was needed). The JSON looks good.
Is there a manual way of generating the code on the Google Console, please?
Thanks for the contributed nodes. Sadly, I have the same problem with the Open Google Authentication button not opening a window. Up to this point was fine (once I realised a TV-style credential was needed). The JSON looks good.
Is there a manual way of generating the code on the Google Console, please?
Solution: OK. Looks like it is a general access token problem related to timezone in Home Assistant 2021.06 as detailed here. I changed my tz to Etc/GMT, and things started working again.
Also does not work for me, maybe googles JSON output is different now?
{ "installed": { "client_id": "XXXXXX", "project_id": "XXXXXX", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "XXXXXXX", "redirect_uris": ["urn:ietf:wg:oauth:2.0:oob", "http://localhost"] } }
I have the same problem, the data is filled in the boxes after pasting, but Open Google authentication button does not open anything. When I check the console, there is the same 404 error as mentioned above. It seems that the button is supposed to open the address http://MYSERVER/google-credentials/authUrl/MYSECRET/MYCLIENTID/REDIRECTURI. So I've tried to open just the part http://MYSERVER/google-credentials (in my case that was http://192.168.1.138:8123/google-credentials ), and I'm getting 404 on this. Like this /google-credentials/ link does not work at all.
@blazejp83 make sure you are accessing node-red directly rather than via homeassistant... It will be the same URL with the port: 1880 rather than 8123
Finally got it working!!! Sorry for the Swedish in the pictures hope it helps anyway.
You should now be able to click on "Add" in Node-red.
I had to click Done on the Node and then open it again to be able to see my Calendars
Hope this works for the rest of u!
@MrDuco thanks for the tutorial. With the local access the "Get Authentication Code" popup worked and I could indeed add the credentials. I also had to press Done on the node and reopen before I got the Calendar IDs. And it took me a while to realize I had to press the (+) button to add the selected calendar(s) before pressing Done.
One issue: when I switch back to Node-RED through Home Assistant, no Calendar IDs are available. Any ideas? Already defined nodes (with selected calendar IDs) still work, but I can't add new ones.
BTW. To get local access working: I was not sure what to use for basic auth, so I (temporarily) added to the config leave_front_door_open: true
.
In addition to the above: after a few days (using Node-RED in HA) I get invalid_grant
similar to #6 and #7
Ok
Dears,
contrib is wonderful and it works perfectly for... ehm 1 week more or less.. then i got this message: API Error: invalid_grant ... I open the conif page and the token code disappeared. I reauthorize, I get from google the same token and I copy paste and it works perfectly .. for another week... any clue of what's going on? maybe I have to change some configuration in my google console? many thanks Andrea
@MrDuco Hello, may I ask, how was you able get that JSON with redirecURIs data inside? I am asking, becuase for Calendar-Node we have to create a TV type client, and as so, it doesn't have any redirect URI defined. So i am still not able to get this working. Tried to follow all these steps, byt the Open Google Authentication button still does nothing.
I am working with Node Red on my PC, and i have tried to use my Raspberry IP (manually put into redirect uri textbox)
This is the JSON that i got.
Unfortunatelly nothing happpens. Any help would be very apppreciated.
@MrDuco Hello, may I ask, how was you able get that JSON with redirecURIs data inside? I am asking, becuase for Calendar-Node we have to create a TV type client, and as so, it doesn't have any redirect URI defined. So i am still not able to get this working. Tried to follow all these steps, byt the Open Google Authentication button still does nothing.
I am working with Node Red on my PC, and i have tried to use my Raspberry IP (manually put into redirect uri textbox)
This is the JSON that i got.
Unfortunatelly nothing happpens. Any help would be very apppreciated.
It looks like you have a typo in your code. Remove the last } and try again
@MrDuco The typo is only in my example picture, generally it is not there.
Hello, in step 2, when I click on "open google authentication" nothing happens. No browser window opens. What should I do?