Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete returns oauth_problem=verifier_invalid #58

Open
paulgodard opened this issue Feb 21, 2023 · 3 comments
Open

delete returns oauth_problem=verifier_invalid #58

paulgodard opened this issue Feb 21, 2023 · 3 comments

Comments

@paulgodard
Copy link

Hi
Thank you for maintaining this class... I am new to it but making progress everyday!

I successfully implement the oAuth to get an access token & secret based on the example provided (get_auth_token.php). I can get private photos, so it is working.

I need to delete media at Flickr. That returns an error : Unable to decode Flickr response to flickr.photos.delete request: oauth_problem=verifier_invalid. BTW, I had a similar error when trying to use getRecent. I am on Laravel.

Here is my code...

$accessToken = "xxx";
$accessTokenSecret = "xxx";

$token = new \OAuth\OAuth1\Token\StdOAuth1Token();
$token->setAccessToken($accessToken);
$token->setAccessTokenSecret($accessTokenSecret);
$storage = new \OAuth\Common\Storage\Memory();
$storage->storeAccessToken('Flickr', $token);

$phpFlickr = new \Samwilson\PhpFlickr\PhpFlickr(['flickrKey'],['flickrSecret']);

$phpFlickr->setOauthStorage($storage);

$result = $phpFlickr->photos()->delete($id);
@samwilson
Copy link
Owner

I'm glad it's useful!

Did you do the initial auth request (when getting the request token) with delete permission?

Or, there does seem to be occasions when Flickr will revoke API keys — I've seen that happen on accounts that I've used for testing sometimes, and it's only when I try to re-authenticate that I find that they won't. That's probably less likely if you're using your own account though.

@samwilson
Copy link
Owner

Oh! Another thing that's possible: check your computer time, if it's drifted too far, then the oauth signature can fail.

@paulgodard
Copy link
Author

Hi again
Screenshot 2023-03-03 at 10 54 27

I used your sample that generates the following url (with the delete at the end). Is that correct?
https://api.flickr.com/services/oauth/authorize?oauth_token=72157720874169042-8917c979860f976c&perms=delete

Then I click on it, there is no further options then authorizing (see attached).

Is there a setting at Flickr that forbid to delete media?

I then copy the 2 variables into the script above.

I did it several times, no change... always the same "verifier_invalid".

I need to delete many images on my account... so I need this script to work...

BTW, I checked the clock. My computer was right but Laravel was not set to UTC+2. After correcting that same issue.

I hope you will find a solution... I need to delete so many files!

BTW, how often does the authorization needs to be done? The script often asks me to re-authenticate, almost every morning... is that normal? Is it because I am running that script from my local development server which ip might change often?

Maybe the delete does not work because I run that script from my local server? Is that possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants