Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I have multiple twitter oauth callback urls

I have created a Twitter application and specified the following url as the callback url:

http://www.myapp.com/login

However, when a user comes to my site from the url myapp.com (missing the www prefix) the authentication fails.

Apparently, I cannot have multiple urls. So what can be a workaround?

like image 706
George Eracleous Avatar asked Oct 05 '12 17:10

George Eracleous


People also ask

How do I enable three legged OAuth on Twitter?

On the dashboard, https://developer.twitter.com/en/portal/projects-and-apps in one of your apps, Authentication settings “Edit” button, and there should be a “Enable 3-legged OAuth” switch that enables the Callback URL field.

What is Auth callback URL?

The “User authorization callback URL” is the URL that people are redirected to after they authorize your GitHub App to act on their behalf. This is the user-to-server OAuth flow for GitHub Apps.

Does Twitter use OAuth?

Twitter allows you to obtain user access tokens through the 3-legged OAuth flow, which allows your application to obtain an access token and access token secret by redirecting a user to Twitter and having them authorize your application.


1 Answers

You can either

  1. Feed the correct OAuth URL by changing it based on the hostname the user uses to access your app.
  2. Implement a canonical domain name, making sure visitors are redirected to the www version (or vice versa).

No, you cannot feed multiple URLs to the OAuth service.

like image 85
driis Avatar answered Oct 04 '22 15:10

driis