Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6896827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:05:33+00:00 2026-05-27T07:05:33+00:00

I’m trying to implement the YouTube API on my codeIgniter website. I followed the

  • 0

I’m trying to implement the YouTube API on my codeIgniter website.
I followed the Jim Saunders instructions here :

and here : http://codeigniter.com/wiki/OAuth_for_Google/
(approximately the same)

SO first of all, I needed to get the token secret with a request_youtube 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 :

The Url I got is :

mywebsite/example/access_youtube=&oauth_verifier=6wbPcxlOAmYQwaDU7HIhz38B&oauth_token=1/6Nfchy_nM-j4vxQzhAWTuc1J20L02bBNdcZasQP-e0s

and codeIgniter doesn’t understant the “/” and doesn’t redirect me to the example/access_youtube function, If I correct it manually, then I go to my access_youtube function with my parameters but here is second (fatal) problem I got :

First, here are my two variables I got from the url :

oauth_verifier=6wbPcxlOA************
&
oauth_token=1/6Nfchy_nM-j4vxQzhAWTuc1J20L02b***********

yet, on the google Oauth Playground (that you’ll be able to find here : http://googlecodesamples.com/oauth_playground/)
I’m supposed to get something like that :

oauth_token=1/P9o-yO1Czz1q67pvPm**********************iMI&
oauth_token_secret=CzeSat342hO5HzswJEq94ZPH&oauth_callback_confirmed=true

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 ?

Second,
I got several errors in my access_Youtube function, CI tell :

  • -Message: Undefined index: oauth_token
  • -Message: Undefined index: oauth_token_secret

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 ?

Thank You 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:05:34+00:00Added an answer on May 27, 2026 at 7:05 am

    Ok what you are doing till you get redirect back from google is perfectly correct.

    1. oauth_verifier
    2. oauth_token

    oauth_verifier code is one google send you back if user authorize your application to access his/her profile so you need this verifier to get AccessToken with access token you will able to get access to user profile/date what ever scope you have defined.

    oauth_token 
    

    this is associated with your application and Google identify you with this it will remain same for your aplication

    so when you are get AccessToken from google/you tube API by calling something like

    Token token=authGetRequestToken.getRequestToken(service);
    

    this request token contains your secret, so before redirecting user to youtube you need to persist this Token either to database or to the session.Once user redirected back to your application you need to get back this token once you have this token use the verification_code along with this token to get Access_token like

    Token accessToken = authGetAccessToken.getAccessToken((Token)   
     session.get(OAuthConstants.REQUEST_TOKEN), verifier);
    

    and once you have this accessToken you are happy to go

    hope it make sense

    edit1

    Verification_code is being send by the OAuth system to indicate that user has given access and has authorize there self. This is only a part of handshaking mechanism.

    i gone through the page OP has mentioned here is what has been mentioned there

    $response = $this->google_oauth->get_request_token(site_url("/user/youtube_access"));
    $this->_store_somewhere($response['token_secret']);
    

    So it is being asked to store token_secret at some place, you can choose DB or session what ever way you choose as this token_secret will be used to reconstruct the request again at later stage

    in my code example i have saved whole Request_Token which contains token_secret and oauth_token

    once user is redirected back to your application you need to perform the following steps

    $token_secret = $this->_get_from_storage('token_secret');
     $oauth = $this->google_oauth->get_access_token(false, $token_secret);
    

    Here we are retrieving the token_secret we saved in last step and than sending asking Google to provide access_token

    i am also doing almost same thing passing verifier along with token_secret

    hope its clear for you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement this gallery on my website. http://coffeescripter.com/code/ad-gallery/ It is noted in the
Im trying to implement this code: http://wcf.codeplex.com/wikipage?title=Getting%20started:%20Building%20a%20simple%20web%20api and want to add it to my
Trying to implement Piwik using REST API over http but need a little help.
I am trying to implement the youtube_it youtube api wrapper for ruby and have
I am trying to implement a Flash YouTube video player on this page .
Trying to implement the example from here. Facebook Share passes along the URL of
im trying to implement local search api, to retreive data for shops and other
We have recently switched to Mercurial. After watching this helpful video: http://www.youtube.com/watch?v=-k2vLKOUb8s&noredirect=1 I am
All I am currently trying implement something along the lines of dim l_stuff as
trying to implement a dialog-box style behaviour using a separate div section with all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.