Google Oauth 2.0 authentication for limited input device not working -
Google Oauth 2.0 authentication for limited input device not working -
i trying utilize custom java application of mine upload videos youtube business relationship via access limited device raspberry pi running server.
for using google oauth 2.0 limited input device reference.
here facing next problem:
after getting device code via next similar phone call (step 2 link):
post /o/oauth2/device/code http/1.1 host: accounts.google.com content-type: application/x-www-form-urlencoded client_id=1084945748469-eg34imk572gdhu83gj5p0an9fut6urp5.apps.googleusercontent.com& scope=https://www.googleapis.com/auth/youtube google oauth server responds 'user_code' , 'verification_url' (step 3 link):
{ "device_code" : "4/l9fttlrhy96442seuf1rl3klfg3y", "user_code" : "a9xfwk9c", "verification_url" : "http://www.google.com/device", "expires_in" : "1800" "interval" : 5, }
now giving requisite permission opening url responded google server.
finally trying access token google server (step 4 link) posting similar request:
post /o/oauth2/token http/1.1 host: accounts.google.com content-type: application/x-www-form-urlencoded client_id=1084945748469-eg34imk572gdhu83gj5p0an9fut6urp5.apps.googleusercontent.com& client_secret=hdbmmrhz7ejrsm9z2q1ofbsem& code=4/ymslr3fscc1ntuh073duzktjj3ss& grant_type=http://oauth.net/grant_type/device/1.0 but instead of getting 'access_token' response getting next :
status code:400 response: { "error" : "invalid_request", "error_description" : "required parameter missing: grant_type" } note : or without url encoding, problem stays same.
can please help me whether it's google oauth 2.0 api buggy or request faulty?
***************************************update*************************************
i tried same steps alternative tools instead of custom java application, tried fiddler , curl, surprise follows:
all of calls worked right mentioned google oauth 2.0 limited input device curl.
same issue observed fiddler custom java app.
i still unable figure out difference yet, still need help.
************update#2**************
fiddler request:
(url encoded, obscured client secret)
(one can oauth credentials (client_id , client_secret) next this)
post http/1.1 https://accounts.google.com/o/oauth2/token?client_id=308065994473-ur9dd7003ajs6mvr5s4kqnugr6j8tsf2.apps.googleusercontent.com&client_secret=xxxxxxxxxxxxxxx&code=4%2fwr-qitquqb0e4-0lcy0-7rz2kke2&grant_type=http%3a%2f%2foauth.net%2fgrant_type%2fdevice%2f1.0 content-type: application/x-www-form-urlencoded (non url encoded, obscured client secret)
post http/1.1 https://accounts.google.com/o/oauth2/token?client_id=308065994473-ur9dd7003ajs6mvr5s4kqnugr6j8tsf2.apps.googleusercontent.com&client_secret=xxxxxxxxxxxxxx&code=4/wr-qitquqb0e4-0lcy0-7rz2kke2&grant_type=http://oauth.net/grant_type/device/1.0 java code project available @ (maven project, check test case oauth calls):
https://docs.google.com/file/d/0b8ltwbtpf-dvmdzfnhnmzxpcqlk
the value wrong, should utilize grant_type=authorization_code this says.
oauth-2.0 google-oauth android-youtube-api
Comments
Post a Comment