ismarslomic / google-assistant-oauth Goto Github PK
View Code? Open in Web Editor NEWSimple utility for retrieving OAuth 2.0 tokens for access to Google Assistant SDK
Simple utility for retrieving OAuth 2.0 tokens for access to Google Assistant SDK
Hi,
I get this error when I try to run the docker:
#FailureMessage Object: 0x7ed0156c
I've put the client_secret.json file in /home/pi/config
what am i doing wrong ? :(
Code is 4/0ARtbsJrHn5CjFdwddaadMwgybO4wB8LA_sziKadSyp5Zd3K7awdawdaDuvqdwd**
FetchError: request to https://oauth2.googleapis.com/token failed, reason: getaddrinfo EAI_AGAIN oauth2.googleapis.com
.......................
.......................
Hello.
I'm trying to use this to make the tokens file and I think that I'm close but I'm running into an issue.
I've got this setup using a portainer stack and the config looks like this:
version: "3.9"
services:
google-assistant-oauth:
container_name: google-assistant-oauth
image: ismarslomic/google-assistant-oauth:latest
ports:
- "3005:3005"
volumes:
- /home/containers/google-assistant-oauth:/usr/src/config
I've created the client_secret.json file in the /home/containers/google-assistant-oauth directory and copied the content from the client_secret_****.apps.googleusercontent.com.json file into /home/containers/google-assistant-oauth/client_secret.json.
I can start the google-assistant-oauth container and go to it's logs and I get an entry like this:
Go to this URL in your browser: https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype&response_type=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I go to that link and I get a "sign in with Google" page where I see my google account, I click that and hit the continue button.
It then changes to a "http://localhost:3005/oauth2callback?code=xxxxxxxxxxxxxxxxxxxxxxxxx" page that times out. But if replace the localhost part with the IP address of the LXC where docker is running, then I get this:
Authentication successful! Please return to the console.
I go back to the logs of the container and see this:
Tokens acquired.
Tokens saved to /usr/src/config/tokens.json.
However, I don't see a tokens.json file:
root@docker:/home/containers/google-assistant-oauth# ls
client_secret.json
root@docker:/home/containers/google-assistant-oauth#
I'm a bit lost here, where am I going wrong?
Thanks!
When I try to run the command (with or without sudo):
docker run --rm \
-p 3005:3005 \
-v /home/[user]/google:/usr/src/config \
ismarslomic/google-assistant-oauth:latest
TypeError: Cannot read properties of undefined (reading 'token_uri')
at validateClientSecretFile (/usr/src/app/index.js:132:25)
at main (/usr/src/app/index.js:16:3)
at Object.<anonymous> (/usr/src/app/index.js:143:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
The contents of "client_secret.json" (with sensitive data replaced with placeholders) is:
{"web":{"client_id":"[client_id]","project_id":"[project_id]","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":"[client_secret]","redirect_uris":["[redirect_uris]"]}}
I think I mostly have this working, but when the container executes and I get a URL, I'm not sure how to follow that. I copy the URL and access it from Mac, but get a message "can't connect to server" which makes sense because it's trying to go to local host. I don't have a web server on my pi (and accessing via command line) so I tried curl with the URL and that doesn't seem to work or result in a tokens.json file.
How can we get a token valid for more than 24 hours ?
thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.