Note that there are some explanatory texts on larger screens.

plurals
  1. POYouTube API Request : How could I get the Right token ( about Jim S.' code )
    text
    copied!<p>I’m trying to implement the YouTube API on my codeIgniter website. I followed the <a href="http://code.google.com/intl/fr/apis/youtube/articles/codeigniter_library.html" rel="nofollow">Jim Saunders instructions</a> here :</p> <p>and here : <code>http://codeigniter.com/wiki/OAuth_for_Google/</code> (approximately the same)</p> <p>SO first of all, I needed to get the token secret with a <code>request_youtube</code> function, that function works correctly, i’ve entered my consumer key and consumer secret from google and everything is just fine. So then I’m redirected to YouTube to authorize the YouTube access, but when I’m redirected to my site, I got 2 problems :</p> <p>The Url I got is :</p> <p><code>mywebsite/example/access_youtube=&amp;oauth_verifier=6wbPcxlOAmYQwaDU7HIhz38B&amp;oauth_token=1/6Nfchy_nM-j4vxQzhAWTuc1J20L02bBNdcZasQP-e0s</code></p> <p>and <code>codeIgniter</code> doesn’t understant the <code>“/”</code> and doesn’t redirect me to the <code>example/access_youtube</code> function, If I correct it manually, then I go to my <code>access_youtube</code> function with my parameters but here is second (fatal) problem I got :</p> <p>First, here are my two variables I got from the url :</p> <pre><code>oauth_verifier=6wbPcxlOA************ &amp; oauth_token=1/6Nfchy_nM-j4vxQzhAWTuc1J20L02b*********** </code></pre> <p>yet, on the google Oauth Playground (that you’ll be able to find here : <code>http://googlecodesamples.com/oauth_playground/)</code> I’m supposed to get something like that : </p> <pre><code>oauth_token=1/P9o-yO1Czz1q67pvPm**********************iMI&amp; oauth_token_secret=CzeSat342hO5HzswJEq94ZPH&amp;oauth_callback_confirmed=true </code></pre> <p>so that mean I didn’t get the same variables ... why ? how could I get thoses variables instead of the one I got ? Are they the same ?</p> <p>Second, I got several errors in my access_Youtube function, CI tell :</p> <ul> <li>-Message: Undefined index: oauth_token</li> <li>-Message: Undefined index: oauth_token_secret</li> </ul> <p>so it doesn’t get informations from the header ... I don’t really know how to do so, I’ve followed the Jim’ Instructions but I’m a kind of stuck there, does anyone who tried to implement an OAuth access on his site has an idea ?</p> <p>Thank You :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload