Comments (4)
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.
Working. Thank you very much.
from phpflickr.
You aren't using the oauth flow, re read https://github.com/samwilson/phpflickr/blob/master/README.md
from phpflickr.
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)
- Not Getting "oauth_verifier" From $flickr->getAuthUrl($perm, $callbackUrl); HOT 7
- New 6K display size support HOT 4
- Fatal error when trying to run get_auth_token.php in examples HOT 5
- Remove non-PSR6 caching
- Remove all deprecated methods in PhpFlickr HOT 2
- Switch from Travis to Github Actions HOT 1
- Add all missing API methods
- Too few arguments to function Samwilson\PhpFlickr\PhotosApi::search() HOT 2
- Session auth broken HOT 4
- dependency issue upgrading to Symfony 6.2 HOT 7
- Fix Phan suppressions
- delete returns oauth_problem=verifier_invalid HOT 3
- Add User Agent HOT 6
- Drop unsupported dependencies HOT 1
- ideas for next version: error handling and return types
- Allow User-Agent to be set in the constructor
- Help with web-based authentication HOT 2
- flickr-bundle for Symfony developers
- upload not setting privacy HOT 1
- Use live.staticflickr.com rather than farm*.staticflickr.com
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpflickr.