1

I am using cakephp for my project and I want to include the videos listed in one of my channels in vimeo using Advanced API. For this, I'm using the OAuth libraries from the following link

http://code.42dh.com/oauth/

This is my code for index and the callback functions

public function index(){
        $this->set('title_for_layout', 'Administrator | Videos');               
        $client = $this->createClient();
        $requestToken = $client->getRequestToken('https://vimeo.com/oauth/request_token', 'http://' . $_SERVER['HTTP_HOST'] . '/example/callback');

        if ($requestToken) {
            $this->Session->write('vimeo_request_token', $requestToken);
            $this->redirect('https://vimeo.com/oauth/authorize?oauth_token=' . $requestToken->key);
        } else {
            echo "An error has occured";
        }
    }

    public function callback() {
        $requestToken = $this->Session->read('vimeo_request_token');
        $client = $this->createClient();
        $accessToken = $client->getAccessToken('https://vimeo.com/oauth/access_token', $requestToken);
    }

But when the index page has loaded, it redirects me to the following link

https://vimeo.com/oauth/authorize?oauth_token=

But it should be redirect, authorize and get back to my current app page. Is there any one know how to fix it? I'm trying to do this for a couple of hours now

Thanks

Mujahid
  • 1,227
  • 5
  • 32
  • 62
  • Guys, I found a better solution here `http://stackoverflow.com/questions/17106097/how-to-use-vimeo-advanced-api-to-display-videos?answertab=oldest#tab-top` – Mujahid Dec 14 '13 at 07:42

0 Answers0