I've followed a couple of different guides on this, but I can't seem to get my head around the way in which Uservoice 3-legged OAuth works.
The guides I've followed:
- https://github.com/uservoice/uservoice-php#verifying-a-uservoice-user
- https://developer.uservoice.com/docs/api/php-sdk/ (See: Associating your users with their UserVoice profiles)
I can successfully redirect the user to the uservoice auth screen, which asks for permission, and on clicking "Allow Access" they are taken back to the correct callback URL, however this is where their documentation fails...
Following exactly what they suggest, I do the following:
$access_token = $client->login_with_verifier($_GET['oauth_verifier']);
However this fails of course unless I have a $client
, so, I make that as I did on the last request... but then it complains that UserVoice\Client::$request_token
isn't set on line 130 (see here).
And the only way to set that variable, is to recreate the auth link... which generates a whole new OAuth process, so it inevitably fails authentication.
I'm wondering if anybody knows how I can work around this?