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 use google-oauthlib-tool tool to get JSON data without credential field. I want to run demo on smartphones. Who helped me? Thank you! #90

Open
2014james opened this issue Jan 8, 2019 · 1 comment

Comments

@2014james
Copy link

static UserCredentials fromResource(Context context, int resourceId)
throws IOException, JSONException {
InputStream is = context.getResources().openRawResource(resourceId);
byte[] bytes = new byte[is.available()];
is.read(bytes);
JSONObject json = new JSONObject(new String(bytes, "UTF-8"));
return new UserCredentials(
json.getString("client_id"),
json.getString("credential"),
json.getString("refresh_token")
);
}

{
"refresh_token": "。。。",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"client_id": "。。。",
"client_secret": "。。。",
"scopes": [
"https://www.googleapis.com/auth/assistant-sdk-prototype"
]
}
no credential field?why

@2014james
Copy link
Author

I solved it. I modified it like this, json. getString ("client_id").
// json. getString ("credential"),
Json. getString ("client_secret"),
Json. getString ("refresh_token")

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

1 participant