Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I don't know how to use this google-oauthlib-tool tool to get credentials.json #89

Open
2014james opened this issue Jan 3, 2019 · 7 comments

Comments

@2014james
Copy link

I installed the python environment and installed the google-oauthlib-tool package via the pip command. I don't know the python language. I don't know how to use this google-oauthlib-tool tool to get credentials.json. Can anyone tell me the specifics? How to use, my project is android, thank you very much

@Fleker
Copy link
Collaborator

Fleker commented Jan 7, 2019

The instructions are listed in the README. You need to generate the credentials.json based on the client_secret_xxx.json file you download from the Actions console.

google-oauthlib-tool --client-secrets client_secret_XXXX.json \
                     --credentials app/src/main/res/raw/credentials.json \
                     --scope https://www.googleapis.com/auth/assistant-sdk-prototype \
                     --save

@2014james
Copy link
Author

Hello, the credentials have been solved, I want to achieve the function is: develop an app like Google assistant assistant assistant to run on the smartphone, can this demo run directly on the smartphone, I do not know what this Google assistant has to do with Android things, I see the code about hardware LED lights, I do not understand what it means, Ma. Thank you for your help.

@2014james
Copy link
Author

Hello, why does the JSON I got have no credential field?

@Fleker
Copy link
Collaborator

Fleker commented Jan 8, 2019

You should read about Android Things and the platform differences between it and a standard mobile app.

After generating credentials.json, you will get a file that contains a refresh token, among other fields, which will enable the application to authenticate to your account.

@2014james
Copy link
Author

@Fleker Hello, can you explain the specific problem? I don't know much about things, and it took me a long time to study the credentials. At present, it's rather urgent. I want to make demo run quickly to determine if it's the effect I want. Thank you.

@Fleker
Copy link
Collaborator

Fleker commented Jan 8, 2019

The Google Assistant API does not work anonymously. It needs to be authenticated with a user's account, which will provide personal answers to that user.

You first need to download a client secret from the Actions console. The client secret JSON essentially contains a project username and password, which allows the google-oauthlib-tool to authenticate to the project-level.

After that, you need to give the project permission to use your user account. Once that happens, it will generate a credentials.json, which will allow the app to authenticate as you and programtically call the Google Assistant.

@AcidRobot
Copy link

AcidRobot commented Nov 22, 2019

I have been trying to get this to work for hours.
I have the client_secrets_xxx.json but when I navigate to the "authorize this application url" I get
I'm trying to register a hardware device and don't want to configure an oAuth2 server, that seems RIDICULOUS!


Error: restricted_client

A native application: Coffee Maker

You can email the developer of this application at: [email protected]

This app is not yet configured to make OAuth requests. To do that, set up the app’s OAuth consent screen in the Google Cloud Console.

Learn more

Request Details
response_type=code
client_id=xxxx
redirect_uri=urn:ietf:wg:oauth:2.0:oob
scope=https://www.googleapis.com/auth/assistant-sdk-prototype
state=lgMkmlmtvGQZhkWS1jeMg77HEyANEJ
prompt=consent
access_type=offline
That’s all we know.```


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants