New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFTwitterUtils no longer working after Twitter changed callback #1310

Closed
MMSSolutions opened this Issue Jun 13, 2018 · 10 comments

Comments

Projects
None yet
3 participants
@MMSSolutions

MMSSolutions commented Jun 13, 2018

My ios app was working with PFTwitterUtils up until yesterday when Twitter can done something to the Callback urls. I'm only using PFtwitterUtils for signup or log in to my app but now i get the error message "Failed to request authorization token from Twitter" when trying to invoke the twitter sign in screen using [PFTwitterUtils logInWithBlock:^(PFUser *user, NSError *error).

From previous documentation I read the "Enable Callback Locking checkbox " must be unchecked on my twitter app @ app.twitter and a valid callback url. It would appear from Twitters recent announcement that they are going to remove the checkbox and force all to enable callback locking.

Is there something I can do so fix this? Or is this an issue that needs to be resolved in PFTwitterUtils?

Thanks,

@flovilmart

This comment has been minimized.

Member

flovilmart commented Jun 13, 2018

So we should probably adapt in the SDK for those new changes. I wasn’t aware

@flovilmart

This comment has been minimized.

Member

flovilmart commented Jun 13, 2018

Do you have more informations regarding recommended twitter login flows etc... ?

@MMSSolutions

This comment has been minimized.

MMSSolutions commented Jun 13, 2018

I only just found out about this when I was testing the login features of my app and a search bought me to the following tweet from twitterapi:

https://twittercommunity.com/t/action-required-sign-in-with-twitter-users-must-whitelist-callback-urls/105342

I cant seem to find any information about mobile apps though as Im sure the callbacks where just for web based authentication.

@flovilmart

This comment has been minimized.

Member

flovilmart commented Jun 13, 2018

So I believe everything should work as expected if uou’re following the guides from twitter to setup the authentication Correctly?

@MMSSolutions

This comment has been minimized.

MMSSolutions commented Jun 13, 2018

@flovilmart

This comment has been minimized.

Member

flovilmart commented Jun 13, 2018

I won’t have time to look into it in the coming days. So feel free to investigate also acquiring an access token from twitter without the Parse SDK.

The iOS SDK let you provide any custom authentication provider, so if you manage to acquire a valid authentication, you can still move forward using it.

@btanev

This comment has been minimized.

btanev commented Jun 14, 2018

Hi @MMSSolutions

I had a similar problem recently, i'm not using the ParseTwitterUtils but the twitter SDK and this also happens.

The solutions was to add the callback url you use in your application (or Parse Twitter utils uses) in https://apps.twitter.com

For the official twitter SDKs the callback urls are (this is from a tweet):

Callback URLs will be required to native apps too. If you are using custom URI scheme just enter the scheme as the callback URL. twitterkit-<consumerKey>:// if using Twitter Kit for iOS or twittersdk:// if using Twitter Kit for Android.

Just from a quick search in the code of Parse Twitter Utils I've found this (method: _getRequestTokenAsync:(BOOL)isReverseAuth):
https://github.com/parse-community/Parse-SDK-iOS-OSX/blob/master/ParseTwitterUtils/ParseTwitterUtils/PF_Twitter.m#L191

It looks like you have to add the following URL as a callback url in you twitter app configuration:

http://twitter-oauth.callback
@flovilmart

This comment has been minimized.

Member

flovilmart commented Jun 14, 2018

It looks like you have to add the following URL as a callback url in you twitter app configuration:

This looks like it would work, I believe, let us know @MMSSolutions , we'll add it to the docs if that's all good with that.

@MMSSolutions

This comment has been minimized.

MMSSolutions commented Jun 14, 2018

Hi @btanev @flovilmart

Thank you so much! For me, in my test application it is now working. Now I will get my client to add to their callback url.

Thanks again!

I think some of the PFTwitterUtils tutorials out there will need updating for this as not ANY valid url can be used anymore.

Cheers!

@flovilmart

This comment has been minimized.

Member

flovilmart commented Jun 14, 2018

@MMSSolutions do you have any link to the existing tutorials that could help us put the right URL's there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment