Twitter App not taking localhost and 127.0.0.1 as CallbackUrl
Asked Answered
A

3

9

I am developing an Application on my localhost environment. Where I want to implement Twitter OAuth functionality in PHP. So I just went on dev.twitter.com and was trying to create an app but its not allowing me to pass Callback URL as localhost or 127.0.0.1.

1) Firstly I tried as localhost

Callback URL as localhost

2) Then I tried as localhost/demoproject

Callback URL as localhost with projectname

3) After I tried IP with project name

Callback URL as IPAddress with projectname

But its taking it as a invalid callback/url format.

Error

Is there any way to deal with this?

Thanks

Azriel answered 17/1, 2013 at 4:41 Comment(0)
O
16

For localhost, use the following URLs in your dev.twitter.com application setup:

Website URL: http://127.0.0.1:8000/twitter/oauth
Callback URL: http://127.0.0.1:8000/twitter/oauth

And don’t worry, these are just placeholders, as long as your code sends the correct callback URL when it connects, things ought to work...

Octavla answered 22/4, 2013 at 17:51 Comment(1)
Thank you so much.Gunnar
O
2

You can provide a Valid URL only for developing Twitter app. Local testing it should be http://127.0.0.1/folder_name.

If both are not working, Hope this topic will help you.

Orva answered 17/1, 2013 at 4:46 Comment(2)
I tried with http://127.0.0.1/folder_name. You can check my 3rd point in my postAzriel
I heared while registering an app in twitter it will ask callback urlOrva
T
0

Former Twitter Employee's Answer - see @episod's post

It turns out that adding a localhost address is not what you should be doing for development anyhow. In the OAuth handshake, your app should provide a callback URL which will override the configured URL on the config page.

The solution is to simply add any URL there as a placeholder.

Twelvemo answered 12/3, 2015 at 16:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.