Giter Site home page Giter Site logo

Comments (4)

sfatfarma avatar sfatfarma commented on August 25, 2024 1

Hello,

Thank you @willpower232 for pointing this out.

My code is this:

        $f = new \Samwilson\PhpFlickr\PhpFlickr($api_key, $api_secret);
        $storage = new \OAuth\Common\Storage\Memory();
        $f->setOauthStorage($storage);
        $access_token = $f->retrieveAccessToken($_GET['oauth_verifier'], $_GET['oauth_token']);

The 2 URL parameters $_GET['oauth_verifier'], $_GET['oauth_token'] are correct. However, when I call the retrieveAccessToken method, I get this exception:

Token not stored

I checked the code and it seems that the retrieveAccessToken method expects the $storage parameter to already have an access token in it.

Code from OAuth\Common\Storage\Memory.php:

    public function retrieveAccessToken($service)
    {
        if ($this->hasAccessToken($service)) {
            return $this->tokens[$service];
        }

        throw new TokenNotFoundException('Token not stored');
    }

I am thinking that I am not using the correct version of \OAuth\Common\Storage\Memory() - right now I am using this: https://github.com/Lusitanian/PHPoAuthLib/blob/master/src/OAuth/Common/Storage/Memory.php

Is this correct? Thank you for the info!

Regards,
Szabi.

from phpflickr.

sfatfarma avatar sfatfarma commented on August 25, 2024 1

Working. Thank you very much.

from phpflickr.

willpower232 avatar willpower232 commented on August 25, 2024

You aren't using the oauth flow, re read https://github.com/samwilson/phpflickr/blob/master/README.md

from phpflickr.

sfatfarma avatar sfatfarma commented on August 25, 2024

Got it.

$storage = new \OAuth\Common\Storage\Session();

Instead of:

$storage = new \OAuth\Common\Storage\Method();

Thank you, working.

Regards.

from phpflickr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.