Elegant solution to Twitter Auth yet?

#1

I’ve read the other posts on Twitter OAth and some ways to jerryrig it into Expo. However, I’m wondering if a solution has been found that doesn’t involve detaching or using a webview? I’m surprised this question keeps getting asked considering how popular Twitter really is. Thanks for any help!

#2

Hey @mekyleh,

Unfortunately there isn’t an elegant solution as you alluded to at this point. Integrating it would still depend on either a webview or detaching. If you haven’t already, I would upvote this FR on our Canny: https://expo.canny.io/feature-requests/p/log-in-with-twitter

Cheers,

Adam

#3

I’ve been looking at this project https://github.com/expo/auth0-example. It looks like it will work well, however, it doesn’t go into details about what the callback url should be on the Twitter settings side of things. As such, I’m constantly getting an error every time I try to connect to Twitter. The error says:

result Object {
  "errorCode": undefined,
  "params": Object {
    "error": "access_denied",
    "error_description": "Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings",
    "exp://localhost:19000/--/expo-auth-session": "",
  },
  "type": "success",
  "url": "exp://localhost:19000/--/expo-auth-session#error=access_denied&error_description=Callback%20URL%20not%20approved%20for%20this%20client%20application.%20Approved%20callback%20URLs%20can%20be%20adjusted%20in%20your%20application%20settings",
}

I’ve tried adding everything I can think of under the Auth0 and Twitter callback URL fields but nothing seems to work. However, when I look at the demo application it works fine. I’m not sure if anyone has access to the Auth0 project settings or to the Twitter app settings, but this is the last hiccup I have on getting Twitter to work in a somewhat reasonable fashion.

#4

Hey @mekyleh,

I believe you’ll have to go into the Twitter Developer console and add the callback URL to the field there so that it enables permissions from Twitter’s end.

Cheers,

Adam

#5

@adamjnav That’s what my question is. I went to the Twitter Developer console for my app and I went to the settings tab and tried adding different things to the callback URL none of it works. Here’s what I’ve tried so far:

exp://
exp://localhost:19000
exp://localhost:19000/--/expo-auth-session
expo://
https://auth.expo.io/@{MYID}/{PROJECTID}
https://{PROJECTID}.auth0.com

Obviously I used the correct values for MYID and PROJECTID. Have you been able to get something to work for this field?

Twitter reject my expo Auth url as Callback URL
#6

I figured out the issue. In the Twitter Developer console for the callback Url I was using:

https://PROJECTID.auth0.com/callback

and it should have been:

https://PROJECTID.auth0.com/login/callback

As the second callback Url I have added:

exp://

And it works like a charm. Hopefully, this helps someone in the future.

#7

My bad for the initial misunderstanding haha. Thanks for posting the solution. Always appreciate people giving back to the community!

Cheers,

Adam

closed #8

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.