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

Session auth broken #50

Closed
clintonb opened this issue Jul 13, 2022 · 4 comments
Closed

Session auth broken #50

clintonb opened this issue Jul 13, 2022 · 4 comments
Labels
Bug It doesn't do what it says it does.

Comments

@clintonb
Copy link

I followed the example in examples/get_auth_token.php, and the web authentication failed after being redirected from Flickr with the query params. The page rendered as follows:


Warning: Undefined array key "oauth_token" in /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/carlos-mg89/oauth/src/OAuth/OAuth1/Service/Flickr.php on line 68

Warning: Undefined array key "oauth_token_secret" in /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/carlos-mg89/oauth/src/OAuth/OAuth1/Service/Flickr.php on line 69

Warning: Undefined array key "oauth_token" in /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/carlos-mg89/oauth/src/OAuth/OAuth1/Service/Flickr.php on line 70

Warning: Undefined array key "oauth_token_secret" in /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/carlos-mg89/oauth/src/OAuth/OAuth1/Service/Flickr.php on line 71
$accessToken = ""; $accessTokenSecret = "";
Fatal error: Uncaught Samwilson\PhpFlickr\FlickrException: Unable to decode Flickr response to flickr.test.login request: oauth_problem=token_rejected in /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/samwilson/phpflickr/src/PhpFlickr.php:358 Stack trace: #0 /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/samwilson/phpflickr/src/TestApi.php(33): Samwilson\PhpFlickr\PhpFlickr->request('flickr.test.log...', Array, true) #1 /Users/clintonb/workspace/clintonb/wp-flickr-base/examples/get_auth_token.php(63): Samwilson\PhpFlickr\TestApi->login() #2 {main} thrown in /Users/clintonb/workspace/clintonb/wp-flickr-base/vendor/samwilson/phpflickr/src/PhpFlickr.php on line 358
samwilson referenced this issue in carlos-mg89/PHPoAuthLib Jul 13, 2022
@samwilson
Copy link
Owner

This appears to be due to this change: carlos-mg89/PHPoAuthLib@f08a062

samwilson added a commit to samwilson/PHPoAuthLib that referenced this issue Jul 13, 2022
In carlos-mg89@f08a062
the AbstractToken::__sleep() method was added,
but it breaks serialization of request tokens (as stored in sessions).

Bug: samwilson/phpflickr#50
@samwilson samwilson added the Bug It doesn't do what it says it does. label Jul 13, 2022
@clintonb
Copy link
Author

That commit came from upstream of the fork: daviddesberg/PHPoAuthLib#584. Still not sure why it’s there. Thanks for digging in!

@samwilson
Copy link
Owner

0.8.15 of the PHPoAuthLib is out, and upgrading makes examples/get_auth_token.php work again in the browser-based workflow. No changes required to PhpFlickr.

@clintonb
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug It doesn't do what it says it does.
Projects
None yet
Development

No branches or pull requests

2 participants