REST Resource OAuth Session not redirecting to Twitter


(Jamie Smith) #1

Matrix Version: v5.4.0.1

Hello. Our Twitter widget has stopped working and as part of troubleshooting I’m trying to re-authenticate the relevant REST Resource OAuth Session asset with Twitter by going to its URL in the browser (as per https://matrix.squiz.net/manuals/web-services/chapters/rest-resource-assets#Example). However, I cannot get it to redirect to Twitter. I have a blank Design (printing only the body) applied to it, Redirect To Authorise is set to Yes, and the Call Back URL is set to the asset’s URL. I’ve tried to authenticate with the existing asset, as well as a newly created asset, to no avail.

I see there are a couple of other topics related to this (REST Resource OAuth Session won't redirect, REST Resource OAuth Session not redirecting to provider), but neither seems to have a resolution.

Do you know whether there is any resolution or workaround to this issue?

Cheers.


(Jamie Smith) #2

Does anyone from Squiz have information on this issue? If it’s indeed a bug and there is no workaround, I’ll most likely have to rebuild the relevant bit of functionality in PHP. Many thanks.


(Tbaatar) #3

Last time I tried this implementation back in version 5.4.0.0 it worked fine, unless Twitter made changes to its oAuth recently.


(Jamie Smith) #4

Thanks. The issue seems to be that Matrix won’t redirect from the REST Resource OAuth Session asset to https://api.twitter.com/oauth/authorize in the browser in order that I can obtain an Access Token. I’ve tested setting up a Oauth2 Token and that does redirect. However, with that I keep getting a ‘there is no request token’ error.

Will move on to trying it in PHP now.


(Tbaatar) #5

Hi Jamie,

I just tested the implementation on older version of Matrix following the manual and it works:
http://bornresponsive.com/web-api/twitter/twitter-feed

Make sure the Rest Resource oAuth Session has public permission and live, and after authorization you will just get a blank white page (or depending on the design file set to this asset). Go back to the details screen of the Rest Resource oAuth Session and check if it has the Access Token. If yes, it means it has worked and therefore set the Store Access Token to Yes.

Now Create a Rest Resource JS asset and set the Auth type to oAuth and include the oAuth Session asset.

For quick test just use the example provided in the manual.