Topic-icon Twitter Error

1 year 7 months ago - 1 year 7 months ago #68232 by chramb1
Twitter Error was created by chramb1
I've configured the Twitter provider with the API key and secret. When I log in with Facebook, it asks me if I want to connect Twitter. When I say yes (or when I try to log in with Twitter from the login modal), I get a new page with this error:

0 Bad request token!

I also get that error on the channels tab when adding Twitter as a channel and clicking to sign in to associate the channel with a user.

I've double-checked the API key and secret. Twitter developer dashboard shows my app valid and active.
Last edit: 1 year 7 months ago by chramb1.
The topic has been locked.
1 year 7 months ago #68233 by chramb1
Replied by chramb1 on topic Twitter Error
Aw, ignore me. It's late ;)

I didn't have the configuration right (callbacks and request-email)
The topic has been locked.
1 year 7 months ago #68234 by chramb1
Replied by chramb1 on topic Twitter Error
Okay, still have errors.

Now, when I try to log in, I get the proper Twitter page that asks me if I want to authorize the user. The permissions it asks for are huge! Posting and all other privs. I can see why this is needed for the streams and such, but this is asking the huge permissions for regular log in, too!

Regardless, when I say yes, I'm redirected back to my site, but I'm not logged in. When I use the link on the social channels page, it opens a new window and does the same thing. Closing that window once I've done the auth (but am still not logged in), I still can't create a social channel.

I do note that the documentation is a step behind Twitter's current workflow. Maybe I'm doing something wrong?
The topic has been locked.
Support Specialist
1 year 7 months ago #68239 by mel
Replied by mel on topic Twitter Error

Now, when I try to log in, I get the proper Twitter page that asks me if I want to authorize the user. The permissions it asks for are huge! Posting and all other privs. I can see why this is needed for the streams and such, but this is asking the huge permissions for regular log in, too!

The only scopes that are accessible for the app are in the User Authentication Settings area. If you want to use Channel features to write back to Twitter, then you'll need 'Read/Write' access. If you want automatic registration where the Joomla user can automatically be created, you'll need to ask for email. Other than that, afaik there's not really a way to turn off some of the app permissions being requested.

Regardless, when I say yes, I'm redirected back to my site, but I'm not logged in. When I use the link on the social channels page, it opens a new window and does the same thing. Closing that window once I've done the auth (but am still not logged in), I still can't create a social channel.


Maybe I'm looking at the wrong site of yours (I used the one you ran through Autotune this morning), but I was able to create a Twitter user on the front-end fine and it logged me in properly. Are you still having this problem? If so, could you go into your Twitter app and let me know the values for your 'User Authentication settings', specifically your callback and website url values. Are there any error messages in the Twitter backend channel of JFBC?

I do note that the documentation is a step behind Twitter's current workflow. Maybe I'm doing something wrong?

It's very possible that we're out of date in our documentation. The social network requirements for app set up change quite frequently.
The topic has been locked.
1 year 7 months ago #68240 by chramb1
Replied by chramb1 on topic Twitter Error
So the documentation says to request read/write. Adding write adds permissions to post on behalf of the user, which I don't want. I should think read and email get the job done. But even so, that doesn't solve the actual problem of the user not being logged in.

I want people to be able to log in with Twitter. I want to be able to create a social channel so I can read a twitter feed and have it displayed in the appropriate module. This works on many of my other sites, so I'm trying to figure out why this one is different.

I ran no autotune this morning. I did yesterday evening. The site is www.burnsherpa.com if that helps.

User Authentication:

App Permissions: Read
Email: YES

Type of App: Web App

App Info:

www.burnsherpa.com/index.php
www.burnsherpa.com/index.php
burnsherpa.com/index.php
burnsherpa.com/index.php

Website URL: www.burnsherpa.com

No errors in the channel, but there is no channel yet! I create one, and it requires me to authenticate a user before I can save, and, as I'm showing, the authentication isn't working.

If I'm logged out of Twitter, it asks me to log in. It asks me to grant my app permissions, and I say yes. It then redirects back to my site but nothing has happened. No login.

If I'm logged IN to Twitter, it shows that it's immediately returning me to my site, then does so, again with no login happening.

If not logged in, here is the URL that Twitter is returning to: www.burnsherpa.com/component/jfbconnect/...urn=L2luZGV4LnBocA==

Note, this is NOT in line with the return OATH URL list, is it?

When this URL is hit, all I see is my home page again. No login. No registration page.

How much do you want to bet that there is a cached token somewhere, and my admin accounts are failing on it?

I'm going to investigate.

I see a new user on my site, so yeah, looks like it worked just fine for you. But not for me!
The topic has been locked.
Support Specialist
1 year 7 months ago #68245 by alzander
Replied by alzander on topic Twitter Error
I just tested registering on your site with a different account. A few notes:

1) When I'm asked to grant permissions, this is the prompt I see:

This application will be able to:

See Tweets from your timeline (including protected Tweets) as well as your Lists and collections.
See your Twitter profile information and account settings.
See accounts you follow, mute, and block.
See your email address.

That's what a normal user will see. For a Channel, more permissions will be required, but that's the normal set for non-channel owners

2) When I logged in with Twitter I was brought to the same page you reference above:

component/jfbconnect/?view=loginregister&provider=twitter&return=L2luZGV4LnBocA==

At first, I thought something was wrong as well.. but that is the correct page to be redirected to in certain circumstances. If you scroll down on that page, you'll see a view for logging into an existing Joomla account or registering a new one. That is normal behavior of JFBConnect and when you select an option (login or register), the Joomla account is created/updated and associated with Twitter.

That page should only show if you have the "Enable Automatic Registration" option set to "No" -- OR -- if JFBConnect is not able to retrieve a critical piece of information about the user to create their account (like their name or email address). In my case, the email address was already filled out, so my thought is simply that Automatic Registration is disabled.

Please double check the page you redirect to after authenticate with Twitter and scroll down to make sure you see what's on the page.. and double-check the Automatic Registration setting in JFBConnect.

I hope that helps, but let us know what you find!

Thanks,
Alex
The topic has been locked.
1 year 7 months ago #68246 by chramb1
Replied by chramb1 on topic Twitter Error
Yes, I changed the permission from the recommended read/write to just read, so that extended permissions aren't asked-for. We'll see if the lack of "write" has any issues going forward.

I'm wondering if the issue is that this redirect has registration content well below the fold. My web site has a lot of content before the "main" section. Nobody's going to see the registration content if they don't scroll down and hunt for it. Even I, an experienced used, didn't think to do this.

I could make a template style that has only the main area above the fold, but that would require having this URL assignable via a menu item so the template style could be specified.

Is this possible?
The topic has been locked.
Support Specialist
1 year 6 months ago #68267 by alzander
Replied by alzander on topic Twitter Error
I'm sorry for the delay. We're in SW Florida and just starting to get power and internet back to a reliable state.

The registration content that we display is in the 'Component' area of your template. If you have modules defaulted to display in ever view, then they can push this component area down. That's true of many default Joomla pages, like forgot password, registration and other views that may be accessed directly.

As an aside, you *can* setup a menu item to "Register a new user", but some extensions just hard-code a link to
/index.php?option=com_users&view=registration
Then, some SEF extensions may look up the proper menu item URL for that or you may have other workarounds.. but the point is that there is likely other content on your site that can get 'pushed down' due to default modules being on every page.

Within JFBConnect, we don't have a method to assign an Itemid (menu item) to the loginregister page. However, if you create a custom menu item, you can hard-code that id into JFBConnect's code. Then, you can manually unassign modules from that menu item.

What we generally recommend though is to take the reverse approach and setup modules (espectially in the top of the fold area) to only display on certain menu item pages and *not* "On all pages". That helps alleviate the problem of pushed down content within JFBConnect as well as many other extensions that have some unassignable pages (or bad links from other components to those pages).

I hope that makes sense, but if you need any help with the above or more details, just let me know!

Thanks,
Alex
The topic has been locked.