Simple utility for retrieving OAuth 2.0 tokens for access to Google Assistant SDK.
4.2K
Simple utility wrapped in Docker image for retrieving the OAuth 2.0 tokens for access to Google Assistant Service.
Bugs and questions related to the source code and Docker image can be reported at Github Issues in the ismarslomic/google-assistant-oauth repo.
In order to access the Google Assistant Service you need to retrieve access and refresh tokens by using Google OAuth2 implementation, this is explained in Google Authorization and Authentication documentation .
This utility simplifies going through the OAuth2 flow and was created in the context of implementing embedded Google Assistant for broadcasting message to Google Assistant enabled speakers, see ismarslomic/google-assistant-broadcast .
Application type of the OAuth Client is Desktopclient_secret_****.apps.googleusercontent.com.json to client_secret.jsondocker runReplace /home/pi/config with full path to the folder where your client_secret.json file is
located.
Warning To avoid write permission issues inside container, please use a folder with ownership of the OS user you are logged in with. Typically
/home/pion RPI or/home/ubuntuon Ubuntu.
When docker container is terminated and the OAuth2 flow finished, you will find tokens.json
file produced in the same folder.
docker run --rm \
-p 3005:3005 \
-v /home/pi/config:/usr/src/config \
ismarslomic/google-assistant-oauth:latest
Click on the URL provided in the console output from the Docker container.
client_secret.json file{
"installed": {
"client_id": "****.apps.googleusercontent.com",
"project_id": "you-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": "****",
"redirect_uris": [
"http://localhost"
]
}
}
Content type
Image
Digest
sha256:ecb4fd28a…
Size
51.7 MB
Last updated
about 4 years ago
docker pull ismarslomic/google-assistant-oauth