chroa / twitter-connect-plugin

Cordova/PhoneGap plugin to use Twitter Single Sign on
Apache License 2.0
10 stars 16 forks source link

Suddenly Request failed: forbidden (403) #19

Open JaponicaGR opened 6 years ago

JaponicaGR commented 6 years ago

Hello everyone,

I had installed this plugin and works properly for a week but suddenly today i am getting error: Request failed: forbidden (403)

This happens on login and before the popup open.

Any ideas?

mreis92 commented 6 years ago

I started experiencing some issues with the authentication in the plugin as well.

Double check that the user has the Twitter application installed, and that your Twitter app has the callback URLs registered.

I am not sure what may be the root cause of the problem, but it seems like Twitter might have done some changes on their end

JaponicaGR commented 6 years ago

@mreis92 I have this http://localhost:4000 as callback url and Callback URL Locked to NO What you propose?

I also didn't say that the authorization popup not even fire.

All those happens today

mreis92 commented 6 years ago

The same for me. I haven't been able to fix the issue, just so that we are clear :)

For Android, if I have the application installed, I am able to see the popup. For iOS I also don't see the authorization popup, I am trying to find a workaround now.

I am guessing that we need a specific URL to bypass this issue. Have you tried http://127.0.0.1:4000?

PS: I am using the Ionic framework btw, so localhost should work for me, but it doesn't.

JaponicaGR commented 6 years ago

I use Ionic too so this don't gonna make a difference.

So what's next? Do you believe we gonna have some feedback from contributors?

Please if you find something let me know. It is too important! :(

mreis92 commented 6 years ago

I think that @chroa was not the original developer of the plugin, but perhaps she can be of assistance when she has the chance. I will continue to research and let you know if I am able to find something

JaponicaGR commented 6 years ago

I tried to reinstall everything about twitter but this time when i try to follow the steps from Fabric desktop app when i add [Fabric with:@[[Twitter class], [Crashlytics class]]]; at AppDelegete.m

i get an error Use of undeclared identifier 'Twitter'

This drive me crazy. Everything works smoothly since yesterday night (that night i had an OS and XCODE update).

UPDATE:

Before yesterday at the second step at the Fabric desktop app configuration you needed to add at the AppDelegete.m this:

Fabric with:@[[Crashlytics class]]];

now they want you to add this:

[Fabric with:@[[Twitter class], [Crashlytics class]]];

but as i say before it is giving you an error because Twitter Class isn't declared.

If you omit the [Twitter class], the app builds succesfully and the app shows at fabric.io dashboard.

I really have no idea if this is relevant to the 403: Forbidden login response.

JaponicaGR commented 6 years ago

@chroa Please if you have some time take a look. Maybe it is a quick fix for you. It is very important. Sorry for bothering you. Keep taking 403 Forbidden!

PS. This is about iOS. Not tested at Android yet!

UPDATE:

I manage to display a more declarative error message:

NSLocalizedFailureReason = "Twitter API error : <?xml version=\"1.0\" encoding=\"UTF-8\"?><errors><error code=\"415\">Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings</error></errors> (code (null))";

mreis92 commented 6 years ago

@JaponicaGR if you are using Ionic3, can you try adding the following URLs to the list of callbacks?

http://localhost:8080 http://127.0.0.1:8080

Let me know if that helps

JaponicaGR commented 6 years ago

@mreis92 I finally figure it out!

At June 12 Twitter announce that they made some changes at the callback url process.

After some search i found this: https://stackoverflow.com/a/50903375/1704408

twittersdk:// works!!!

Thank you twitter team for not documented this properly :)

winniezz commented 6 years ago

Thnk you @JaponicaGR

So , you just have to add twittersdk:// in callback URL in https://apps.twitter.com settings

QaseemLodhi commented 6 years ago

Thanks alot @JaponicaGR you saved my day.

Twitter team please update your document!

jayeshkorat18 commented 6 years ago

Thanks @JaponicaGR