Monday, April 30, 2012

[YouTube-API] Re: OAuth2.0 Error : 405 method not allowed

Hello Sagar,

I assume you're talking about the server-side web application flow,
described at

https://developers.google.com/youtube/2.0/developers_guide_protocol_oauth2#OAuth2_Server_Side_Web_Applications_Flow

In step 4 in that flow, you need to send an HTTP POST request to that
endpoint to get back the tokens. I'm assuming you're sending something
else (like an HTTP GET), which would result in that 405 error.

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev


On Apr 30, 3:31 pm, Sagar <sagarra...@gmail.com> wrote:
> Hello ,
>
> I had issues getting the access token for youtube API using oAuth2.0.  I
> got the the "code" parameter from the step 1:
>
> https://accounts.google.com/o/oauth2/auth?client_id=clientID&redirect...
>
> The resposnse for the above request was like :https://localhost:51799/oauth2callback?code=4/Oj16pMMdXfO410Ji5qP0nTc...
>
> And I tried to exchange the "code" parameter for access token but it's
> throwing an error 405, Method not allowed.
>
> Here is my http request :
>
> https://accounts.google.com/o/oauth2/token?code=4/Oj16pMMdXfO410Ji5qP...
> clientID &client_secret=clientsecret
> &redirect_uri= redirectlink &grant_type=authorization_code
>
> Even the simple http request for access token without any parameters
> "https://accounts.google.com/o/oauth2" throwing the same error.  Please let
> me know If there is anything wrong with the above request.  Any help would
> be appreciated.
>
> Thanks,
> Sagar

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment