Hi Ted,

   I can able to receive the response (i.e) device code and user code. 
Probably you've to set header in your request as "Content-Type": 
"application/x-www-form-urlencoded" and also based on the error you are 
making a get request. try to change it to post method. I'm trying to do 
this from javascript. My code is as follows.

 $.ajax({
      url:<<the url you mentioned below>>,
      type:"POST",
      headers:{
      "Content-Type": "application/x-www-form-urlencoded"
      },
      success:function(data){
      console.log("success");
      console.log( "user code : " + data.user_code);
      console.log( "device code : " + data.device_code);
      console.log( "expire : " + data.expires_in);
      console.log("verification url : " + data.verification_url);
      console.log("intervel : " + data.interval);
      
      },
      error:function(shr,status,data){
      console.log("error " + data + " Status " + shr.status);
      }
     });

   I'm struck with the second stage as requesting for access token with 
device code. I'm always getting bad request error. If you find some 
solution for the second step please let me know.

Thanks,
Aries

On Thursday, March 7, 2013 2:58:41 AM UTC+5:30, Ted Pederson wrote:
>
> Seems so simple from 
> https://developers.google.com/accounts/docs/OAuth2ForDevices:
>
> Like all OAuth2 scenarios, you will first need to register your 
>> application with Google through the Developer 
>> Console<https://code.google.com/apis/console#access>. 
>> To proceed with this flow, you will need the client_id andclient_secret 
>> created 
>> during application registration, and you will need to embed them in your 
>> application.
>> After you have the client_id and client_secret, you send an HTTP POST to 
>> the OAuth 2.0 device endpoint at 
>> https://accounts.google.com/o/oauth2/device/code with your client_id and 
>> a list of scopes. Unlike the other OAuth2 flows, response_type and
>> redirect_uri are not needed in the device flow.
>
>
> However when I POST to 
> https://accounts.google.com/o/oauth2/device/code?scope=
> https://www.google.com/m8/feeds/&client_id=[my ID] I get 405 Method Not 
> Allowed
>

-- 
You received this message because you are subscribed to the Google Groups 
"OAuth" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to