Topics

Tribe Support

Tribe Support's Topics

Rob Saric

Rob Saric

July 18 2018

Twitter connect issue

Hi everyone, 

I've been trying to set up twitter connect for my anahita app - and for some reason I can't seem to get it to work. My steps:

(1) Set up a new app under twitter dev: https://apps.twitter.com/app/

(2) In the 'Connect' app in Anahita add the twitter consumer key (api key) and consumer secret key and enable the connect plugins

(3) I added Callback URLs in twitter under the app (based on the read-only examples) in the 'Connect app'

When i try to enable it i get an null error - ( ! ) Notice: Trying to get property of non-object in C:\wamp64\www\hwarp-app-prod\packages\Connect\src\components\com_connect\oauths\services\abstract.php on line 299Any help or ideas would be greatly appreciated. I may be using the wrong call-back URLs?
  • 10 Comments
  • Last Comment by Rob Saric
Is there a way to get an error message either from Anahita or Twitter?
Rob Saric
Rob Saric
July 18 2018 Permalink
Right now it's not getting to twitter, it breaks before the request is sent and outputs an error from Anahita. This happens whenever I try to enable connect for twitter as a user.
Can you inspect the request in your browser to see what happens when you click on the enable button?
Inspect > Network tab in Chrome
Rob Saric
Rob Saric
July 19 2018 Permalink
This is what I get when I inspect Network
Under Headers:

General:
Request URL: https://mydomain.com/index.php/connect/setting/server/twitter?oid=2
Request Method: POST
Status Code: 200 OK
Remote Address: 137.117.69.182:443
Referrer Policy: no-referrer-when-downgrade

Response Headers:
HTTP/1.1 200 OK
Date: Thu, 19 Jul 2018 13:01:47 GMT
Server: Apache/2.4.33 (Win64) OpenSSL/1.1.0g PHP/5.6.35
X-Powered-By: PHP/5.6.35
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
Date: Thu, 19 Jul 2018 13:01:47 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.4.33 (Win64) OpenSSL/1.1.0g PHP/5.6.35
Transfer-Encoding: chunked
X-Powered-By: PHP/5.6.35
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cache-Control: max-age=0
Connection: keep-alive
Content-Length: 15
Cache-Control: max-age=0
Origin: https://mydomain.com
Upgrade-Insecure-Requests: 1
DNT: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://mydomain.com/index.php/people/2/settings?edit=connect
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Cookie: _ga=GA1.2.189264731.1510596659; b1b00d1b9db5a7c521e9ee20f02b6fdc8328e1873c0fd060cd46e9bd4de3642c=b11ojl48h4f8mbfd3ugvvqanj1; fc5276c1e190694d2f1aa3b605ff28067e992725fd49348f7487383dbc0ceea2=eyJpdiI6IkV0Q3NVV0h4c1FTeUlySGFZQzIxXC9BPT0iLCJ2YWx1ZSI6IjFqRkJBTmR5VWFETmRUS3pjR2xCVlg3bGRiMURBeUs5a21GdGxFWk9yRjh3R2d0NnFcL1NkOENUN1hIazh1TFFYUjlLeWduK0JGRWllZlZoNlJoMEozUHB5bjRaSURjUDRwbGUxWkx4eGh1az0iLCJtYWMiOiIwMjYyN2M3MDkyMTdmYmE0ODk2Mjk4NmE4M2FmNzk1NTdiYTQxMmZmYmQ1OGQwZDQzOWYyZDEzYmQxOGY1MGU2In0%3D

Query String Parameters:
oid=2

Form Data:
get=accesstoken
Could you turn use mod_write to Yes in the Site Settings so it'd remove the index.php from the url? I know OAuth services are quite picky about the urls passed on to them.
When you enable Twitter, it obtains an access token from twitter and stores it in Anahita for the viewer. The access token is later used as a way for twitter to recognize the requests as valid. Looks like Twitter is refusing to give you an access token.
Rob Saric
Rob Saric
July 28 2018 Permalink
Hi @rastin, it seems like Twitter OAuth is causing problems based on my WAMP virtual host settings. I'm using a virtual server (through ms azure) to run my anahita site, and I still can't figure out what's going on. I'll let you know when I figure it out.

Also, as a side note, would the community be interested if we built a modified subscription plugin using Stripe? We're planning on building this, so it might be of use to the community.
Have you added callback urls with localhost or whatever your local WAMP is using? I've noticed that OAuth doesn't play nice if you are hosting Anahita on a subdirectory so make sure Anahita is accessed via localhost directly.

Good idea about subscription app. You can host it on Github and distribute it using composer.
Rob Saric
Rob Saric
August 06 2018 Permalink
Anahita connect app seems to work with LinkedIn and Facebook, just not Twitter oauth. I'll keep at it.

Sounds good, we'll build a subscription app using Stripe :-)
Rastin Mehr liked this

Powered by Anahita