Callback url during development

1,505 views
Skip to first unread message

Jochen Kaechelin

unread,
Apr 22, 2009, 7:25:12 AM4/22/09
to twitter-deve...@googlegroups.com
How to you handle the callback url during oauth development?

I'am just working on a rails app running apache and passenger on my
local machine.

Do i need to allow twitter to get connected to my dev machine which is
reachable by a dyndns address?!

Or are there any other solutions??

Thanx

Abraham Williams

unread,
Apr 22, 2009, 9:17:15 AM4/22/09
to twitter-deve...@googlegroups.com
you can use localhost or whatever you are using locally as a callback. you browser is interpreting it and acting.
--
Abraham Williams | http://the.hackerconundrum.com
Hacker | http://abrah.am | http://twitter.com/abraham
Web608 | Community Evangelist | http://web608.org
This email is: [ ] blogable [x] ask first [ ] private.
Sent from Madison, Wisconsin, United States

Jochen Kaechelin

unread,
Apr 22, 2009, 9:23:07 AM4/22/09
to twitter-deve...@googlegroups.com

Am 22.04.2009 um 15:17 schrieb Abraham Williams <4br...@gmail.com>:

you can use localhost or whatever you are using locally as a callback. you browser is interpreting it and acting.


Ah! Ok! I did not try this. So I only have to edit my registered app settings!!

Great, Thanx. 

Deborah Boyd

unread,
Apr 22, 2009, 9:24:47 AM4/22/09
to twitter-deve...@googlegroups.com
Thanks

Abraham Williams

unread,
Apr 22, 2009, 9:37:35 AM4/22/09
to twitter-deve...@googlegroups.com
Also when you are building the authorize url to send users to twitter.com you can add "&oauth_callback=http://localhost/callback" and that will override your applications registered callback.

Jochen Kaechelin

unread,
Apr 23, 2009, 6:12:20 PM4/23/09
to twitter-deve...@googlegroups.com

Am 22.04.2009 um 15:37 schrieb Abraham Williams:

> Also when you are building the authorize url to send users to
> twitter.com you can add "&oauth_callback=http://localhost/callback"
> and that will override your applications registered callback.
>


OAuth::Consumer.new("xxxxxxxxxx", "xxxxxxxxxx",
{ :site=>"http://twitter.com/oauth/authorize?oauth_callback=http://localhost:3000/callback
" })


I can see the site where I have to Deny or Allow access.
When I click "Allow" I will be redirected to the Domain which I
entered in the
OAUTH Clients Registration Form (http://www.twitter.com/oauth_cleints)

Seems that the oauth_callback parameter does not work!
Is it in the wrong place?

Any hints!?

Thanx


Abraham Williams

unread,
Apr 23, 2009, 6:16:09 PM4/23/09
to twitter-deve...@googlegroups.com
The oauth_callback parameter was just disabled do to security issues. Currently only the registered callback works. If you need a different callback location for development set up a second application.

Jochen Kaechelin

unread,
Apr 23, 2009, 6:21:52 PM4/23/09
to twitter-deve...@googlegroups.com

Am 24.04.2009 um 00:16 schrieb Abraham Williams:

> The oauth_callback parameter was just disabled do to security
> issues. Currently only the registered callback works. If you need a
> different callback location for development set up a second
> application.
>

Ok, then I have to use my dnydns address - I'am not allowed to
register a application
with "http://localhost:3000/callback" as Callback url.

Thanx

Paul Kinlan

unread,
Apr 23, 2009, 6:29:45 PM4/23/09
to twitter-deve...@googlegroups.com
Hi,

During development I tend to modify my hosts file to point the callback URL domain to my box for instance. This is quite good because all it affects is my box.

Paul


Jochen Kaechelin

unread,
Apr 23, 2009, 6:31:53 PM4/23/09
to twitter-deve...@googlegroups.com

Am 24.04.2009 um 00:29 schrieb Paul Kinlan:

> Hi,
>
> During development I tend to modify my hosts file to point the
> callback URL domain to my box for instance. This is quite good
> because all it affects is my box.
>

I just had the same idea ... ;-)

Works as expected now!!!

Thanx

Phil Nash

unread,
Apr 23, 2009, 6:47:19 PM4/23/09
to twitter-deve...@googlegroups.com
That's a great idea, thanks for sharing! I was just wondering what to do now that oauth_callback won't work.

Thanks!
Phil
--
Phil Nash

Web development: http://www.unintentionallyblank.co.uk
Musical stylings: http://www.hammervsthesnake.co.uk
Twitter: http://twitter.com/philnash

Abraham Williams

unread,
Apr 23, 2009, 6:52:45 PM4/23/09
to twitter-deve...@googlegroups.com
This is something else that would be good for a development best practice page on the apiwiki.

Dimebrain

unread,
Apr 27, 2009, 1:58:21 AM4/27/09
to Twitter Development Talk
How are you able to set this up for a non-standard port? HOSTS file is
just for the domain/authority, and you can't specify a port in the
callback URL on the settings page?

On Apr 23, 7:31 pm, Jochen Kaechelin <giss...@gissmog.de> wrote:
> Am 24.04.2009 um 00:29 schrieb Paul Kinlan:
>
> > Hi,
>
> > During development I tend to modify my hosts file to point the  
> > callback URL domain to my box for instance. This is quite good  
> > because all it affects is my box.
>
> I just had the same idea ... ;-)
>
> Works as expected now!!!
>
> Thanx
>
> > Paul
>
> > On 23 Apr 2009, at 23:16, Abraham Williams <4bra...@gmail.com> wrote:
>
> >> The oauth_callback parameter was just disabled do to security  
> >> issues. Currently only the registered callback works. If you need a  
> >> different callback location for development set up a second  
> >> application.
>
> >> On Thu, Apr 23, 2009 at 17:12, Jochen Kaechelin  
> >> <giss...@gissmog.de> wrote:
>
> >> Am 22.04.2009 um 15:37 schrieb Abraham Williams:
>
> >> > Also when you are building the authorize url to send users to
> >> > twitter.com you can add "&oauth_callback=http://localhost/callback"
> >> > and that will override your applications registered callback.
>
> >>OAuth::Consumer.new("xxxxxxxxxx", "xxxxxxxxxx",
> >> { :site=>"http://twitter.com/oauth/authorize?oauth_callback=http://localhost:30...
> >> " })
>
> >> I can see the site where I have to Deny or Allow access.
> >> When I click "Allow" I will be redirected to the Domain which I
> >> entered in the
> >>OAUTHClients Registration Form (http://www.twitter.com/

Paul Kinlan

unread,
Apr 27, 2009, 2:41:31 AM4/27/09
to twitter-deve...@googlegroups.com
I managed to set a port on the page when I was doing some google app
engine stuff.

But saying that my dev server now runs on port 80 on my machine so it
isn't a problem much.

Paul

Benjamin Cox

unread,
Apr 27, 2009, 3:36:21 PM4/27/09
to Twitter Development Talk
Unfortunately, I'm working on a dev machine that's doubling as a web
server for another small project. I simply cannot run on port 80 in
development.

Does that mean there is no way I can test oauth integration with
Twitter? Would you consider adding the ability to put a port number
in the callback URL on the settings page?

Please?

Cheers,

Ben

On Apr 26, 11:41 pm, Paul Kinlan <paul.kin...@gmail.com> wrote:
> I managed to set a port on the page when I was doing some google app  
> engine stuff.
>
> But saying that my dev server now runs on port 80 on my machine so it  
> isn't a problem much.
>
> Paul
>
> On 27 Apr 2009, at 06:58, Dimebrain <daniel.cre...@gmail.com> wrote:
>
>
>
> > How are you able to set this up for a non-standard port? HOSTS file is
> > just for the domain/authority, and you can't specify a port in the
> >callbackURL on the settings page?
>
> > On Apr 23, 7:31 pm, Jochen Kaechelin <giss...@gissmog.de> wrote:
> >> Am 24.04.2009 um 00:29 schrieb Paul Kinlan:
>
> >>> Hi,
>
> >>> During development I tend to modify my hosts file to point the
> >>>callbackURL domain to my box for instance. This is quite good
> >>> because all it affects is my box.
>
> >> I just had the same idea ... ;-)
>
> >> Works as expected now!!!
>
> >> Thanx
>
> >>> Paul
>
> >>> On 23 Apr 2009, at 23:16, Abraham Williams <4bra...@gmail.com>  
> >>> wrote:
>
> >>>> The oauth_callback parameter was just disabled do to security
> >>>> issues. Currently only the registeredcallbackworks. If you need a
> >>>> differentcallbacklocation for development set up a second

Paul Kinlan

unread,
Apr 27, 2009, 4:08:49 PM4/27/09
to twitter-deve...@googlegroups.com
This is going to sound silly, but I had it with a port on the settings page

I added http://www.twedaq.com:8080/oauth in to the oauth conf page, and then changed my host file and all worked really well.

Paul

2009/4/27 Benjamin Cox <b...@insourcery.com>

Mike Lewis

unread,
Apr 27, 2009, 11:56:56 PM4/27/09
to Twitter Development Talk
It doesn't allow you to set http://localhost/ or http://127.0.0.1 as a
callback URL. This is rather frustrating because I don't want to have
to make a fake host and make all my developers make the same fake host
on their respective machines as well, just to get something trivial
like this to work.

On Apr 27, 1:08 pm, Paul Kinlan <paul.kin...@gmail.com> wrote:
> This is going to sound silly, but I had it with a port on the settings page
>
> I addedhttp://www.twedaq.com:8080/oauthin to the oauth conf page, and then

Chad Etzel

unread,
Apr 28, 2009, 12:16:08 AM4/28/09
to twitter-deve...@googlegroups.com
You could create a public DNS entry like dev.domain.com => 127.0.0.1
which would only work for people that actually have a dev environment
setup on their localhost... not the most elegant solution, but it
would work.... mostly.
-chad

Dossy Shiobara

unread,
Apr 28, 2009, 8:16:38 AM4/28/09
to twitter-deve...@googlegroups.com
On 4/27/09 11:56 PM, Mike Lewis wrote:
> It doesn't allow you to sethttp://localhost/ orhttp://127.0.0.1 as a

> callback URL. This is rather frustrating because I don't want to have
> to make a fake host and make all my developers make the same fake host
> on their respective machines as well, just to get something trivial
> like this to work.

Seriously, how many developers do you have? If doing "su -c 'echo
127.0.0.1 mydomainname.com >> /etc/hosts'" is too much for your
developers to handle, the solution isn't to complain to Twitter - the
solution is to find better developers.

--
Dossy Shiobara | do...@panoptic.com | http://dossy.org/
Panoptic Computer Network | http://panoptic.com/
"He realized the fastest way to change is to laugh at your own
folly -- then you can let go and quickly move on." (p. 70)

David M. Wilson

unread,
May 30, 2009, 11:25:55 AM5/30/09
to Twitter Development Talk

On Apr 28, 4:56 am, Mike Lewis <mikelikes...@gmail.com> wrote:
> It doesn't allow you to sethttp://localhost/orhttp://127.0.0.1as acallbackURL.  This is rather frustrating because I don't want to have
> to make a fake host and make all my developers make the same fake host
> on their respective machines as well, just to get something trivial
> like this to work.

Dear Twitter team,

Can you possibly get a developer to go in and delete the code
preventing use of localhost? I can't figure out why it's even in there
- it seemingly does nothing for security, and just serves to frustrate
developers. Any of the millions of sites on the Internet can redirect
a user to 127.0.0.1 or localhost. There's nothing evil about it at
all.

I'm working on a small Twitter tool with a designer who may need to
test changes on their machine. I really don't want to have to explain
to them how to go and edit /etc/hosts!


David

>
> On Apr 27, 1:08 pm, Paul Kinlan <paul.kin...@gmail.com> wrote:
>
> > This is going to sound silly, but I had it with a port on the settings page
>
> > I addedhttp://www.twedaq.com:8080/oauthinto the oauth conf page, and then
> > changed my host file and all worked really well.
>
> > Paul
>
> > 2009/4/27 Benjamin Cox <b...@insourcery.com>
>
> > > Unfortunately, I'm working on a dev machine that's doubling as a web
> > > server for another small project.  I simply cannot run on port 80 in
> > > development.
>
> > > Does that mean there is no way I can test oauth integration with
> > > Twitter?  Would you consider adding the ability to put a port number
> > > in thecallbackURLon the settings page?
> > > > >>>>> Also when you are building the authorizeurlto send users to
Reply all
Reply to author
Forward
0 new messages