[twitter-dev] How come the "No, Thanks" button opens the callback url in a new window/tab?

2011-08-03 Thread Nathan Rajlich
My scenario is that we are opening that authorization page in a popup window
via `window.open()`. When the user clicks "Allow", the popup window is
redirected back to our server, and a page is returned that notified the
opening page (the main window) that authorization is complete, and closes
the popup window.

This flow breaks when the user clicks on "No, Thanks". This is because for
some reason Twitter is opening the callback url, with the ?denied
query-string, in a new window/tab. This leaves the auth popup window
open unnecessarily, and no event being passed back to the original page.

In my opinion, Twitter should be simply redirecting the current window, not
opening a new one, when the user rejects permissions. Or is there a better
place to bring this up with the Twitter team (bug tracker?). Thanks in
advance!

-- 
Have you visited the Developer Discussions feature on 
https://dev.twitter.com/discussions yet?

Twitter developer links:
Documentation and resources: https://dev.twitter.com/docs
API updates via Twitter: https://twitter.com/twitterapi

Unsubscribe or change your group membership settings: 
http://groups.google.com/group/twitter-development-talk/subscribe


[twitter-dev] Re: Getting "Failed to validate oauth signature and token" after adding an explicit "oauth_callback" in the request token phase

2011-08-01 Thread Nathan Rajlich
For anybody whose interested, the problem turned out to be that I was
prefixing Twitter's OAuth URLs with 'www.'. After removing the prefix,
and having the urls be top-level, everything is working as expected.

On Aug 1, 2:04 pm, Nathan Rajlich  wrote:
> Interesting... your example does indeed work as expected! I suppose there
> must be some difference between that and what I am already doing. Thanks for
> the example, hopefully it will help me drill down the problem!
>
>
>
>
>
>
>
> On Mon, Aug 1, 2011 at 12:29 PM, Ciaran  wrote:
> > Hi Nathan,
>
> > On Sun, Jul 31, 2011 at 5:43 AM, Nathan Rajlich 
> > wrote:
> > > Hello all. I am using nodejs, and specifically ciranj's node-oauth[0]
> > > module, attempting to override the default callback URL with an
> > > explicit one as per the 1.0A specification changes. I'm not entirely
> > > sure if it's a bug with the module or just me being dumb, but after I
> > > changing the code from:
>
> > >    request_token_url  // is set to: 'https://www.twitter.com/oauth/
> > > request_token'
>
> > > as the URL posting to (which works) to:
>
> > >    request_token_url + '?oauth_callback=' + encode(callback)
>
> > > where 'callback' could be something like 'http://www.google.com', I
> > > get a 401 response code with a "Failed to validate oauth signature and
> > > token" error message.
>
> > > Any hints in the right direction would be much appreciated. Thanks in
> > > advance!
>
> > Just had a check through my code, and it should work just fine.  I've
> > placed an example working solution inline to this response :)
>
> > var  http = require('http')
> >   , OAuth= require('./index').OAuth
> >   , url = require('url')
> >   , consumerKey= "YOUR_KEY"
> >   , consumerSecret= "YOUR_SECRET"
> >   , callbackURL= "YOUR_CALLBACK;
>
> > var oAuth= new OAuth("http://twitter.com/oauth/request_token";,
> >                        "http://twitter.com/oauth/access_token";,
> >                        consumerKey,  consumerSecret,
> >                        "1.0a", callbackURL, "HMAC-SHA1");
>
> > http.createServer(function (req, res) {
> >   var urlp= url.parse(req.url, true);
> >   if( urlp.query && urlp.query.oauth_verifier ) {
> >     res.writeHead(200, {'Content-Type': 'text/plain'});
> >     res.end('Verification callback: ' + urlp.query.oauth_verifier +'\n');
> >   }
> >   else {
> >     oAuth.getOAuthRequestToken(function(error, oauth_token,
> > oauth_token_secret, oauth_authorize_url, additionalParameters ) {
> >       console.log( error );
> >       res.writeHead(301, {
> >         'Location':
> > "http://twitter.com/oauth/authenticate?oauth_token="; + oauth_token
> >       });
> >       res.end();
> >     });
> >   }
> > }).listen(80, "127.0.0.1");
>
> > Hope this helps :)
>
> > - Cj.
>
> > --
> > Have you visited the Developer Discussions feature on
> >https://dev.twitter.com/discussionsyet?
>
> > Twitter developer links:
> > Documentation and resources:https://dev.twitter.com/docs
> > API updates via Twitter:https://twitter.com/twitterapi
>
> > Unsubscribe or change your group membership settings:
> >http://groups.google.com/group/twitter-development-talk/subscribe

-- 
Have you visited the Developer Discussions feature on 
https://dev.twitter.com/discussions yet?

Twitter developer links:
Documentation and resources: https://dev.twitter.com/docs
API updates via Twitter: https://twitter.com/twitterapi

Unsubscribe or change your group membership settings: 
http://groups.google.com/group/twitter-development-talk/subscribe


Re: [twitter-dev] Getting "Failed to validate oauth signature and token" after adding an explicit "oauth_callback" in the request token phase

2011-08-01 Thread Nathan Rajlich
Interesting... your example does indeed work as expected! I suppose there
must be some difference between that and what I am already doing. Thanks for
the example, hopefully it will help me drill down the problem!

On Mon, Aug 1, 2011 at 12:29 PM, Ciaran  wrote:

> Hi Nathan,
>
>
> On Sun, Jul 31, 2011 at 5:43 AM, Nathan Rajlich 
> wrote:
> > Hello all. I am using nodejs, and specifically ciranj's node-oauth[0]
> > module, attempting to override the default callback URL with an
> > explicit one as per the 1.0A specification changes. I'm not entirely
> > sure if it's a bug with the module or just me being dumb, but after I
> > changing the code from:
> >
> >request_token_url  // is set to: 'https://www.twitter.com/oauth/
> > request_token'
> >
> > as the URL posting to (which works) to:
> >
> >request_token_url + '?oauth_callback=' + encode(callback)
> >
> > where 'callback' could be something like 'http://www.google.com', I
> > get a 401 response code with a "Failed to validate oauth signature and
> > token" error message.
> >
> > Any hints in the right direction would be much appreciated. Thanks in
> > advance!
>
> Just had a check through my code, and it should work just fine.  I've
> placed an example working solution inline to this response :)
>
>
> var  http = require('http')
>   , OAuth= require('./index').OAuth
>   , url = require('url')
>   , consumerKey= "YOUR_KEY"
>   , consumerSecret= "YOUR_SECRET"
>   , callbackURL= "YOUR_CALLBACK;
>
> var oAuth= new OAuth("http://twitter.com/oauth/request_token";,
>"http://twitter.com/oauth/access_token";,
>consumerKey,  consumerSecret,
>"1.0a", callbackURL, "HMAC-SHA1");
>
> http.createServer(function (req, res) {
>   var urlp= url.parse(req.url, true);
>   if( urlp.query && urlp.query.oauth_verifier ) {
> res.writeHead(200, {'Content-Type': 'text/plain'});
> res.end('Verification callback: ' + urlp.query.oauth_verifier +'\n');
>   }
>   else {
> oAuth.getOAuthRequestToken(function(error, oauth_token,
> oauth_token_secret, oauth_authorize_url, additionalParameters ) {
>   console.log( error );
>   res.writeHead(301, {
> 'Location':
> "http://twitter.com/oauth/authenticate?oauth_token="; + oauth_token
>   });
>   res.end();
> });
>   }
> }).listen(80, "127.0.0.1");
>
> Hope this helps :)
>
> - Cj.
>
> --
> Have you visited the Developer Discussions feature on
> https://dev.twitter.com/discussions yet?
>
> Twitter developer links:
> Documentation and resources: https://dev.twitter.com/docs
> API updates via Twitter: https://twitter.com/twitterapi
>
> Unsubscribe or change your group membership settings:
> http://groups.google.com/group/twitter-development-talk/subscribe
>

-- 
Have you visited the Developer Discussions feature on 
https://dev.twitter.com/discussions yet?

Twitter developer links:
Documentation and resources: https://dev.twitter.com/docs
API updates via Twitter: https://twitter.com/twitterapi

Unsubscribe or change your group membership settings: 
http://groups.google.com/group/twitter-development-talk/subscribe


[twitter-dev] Getting "Failed to validate oauth signature and token" after adding an explicit "oauth_callback" in the request token phase

2011-07-31 Thread Nathan Rajlich
Hello all. I am using nodejs, and specifically ciranj's node-oauth[0]
module, attempting to override the default callback URL with an
explicit one as per the 1.0A specification changes. I'm not entirely
sure if it's a bug with the module or just me being dumb, but after I
changing the code from:

request_token_url  // is set to: 'https://www.twitter.com/oauth/
request_token'

as the URL posting to (which works) to:

request_token_url + '?oauth_callback=' + encode(callback)

where 'callback' could be something like 'http://www.google.com', I
get a 401 response code with a "Failed to validate oauth signature and
token" error message.

Any hints in the right direction would be much appreciated. Thanks in
advance!


[0]: https://github.com/ciaranj/node-oauth

-- 
Have you visited the Developer Discussions feature on 
https://dev.twitter.com/discussions yet?

Twitter developer links:
Documentation and resources: https://dev.twitter.com/docs
API updates via Twitter: https://twitter.com/twitterapi

Unsubscribe or change your group membership settings: 
http://groups.google.com/group/twitter-development-talk/subscribe


[twitter-dev] request token by string

2009-11-13 Thread Nathan

I am building a WEB application.
I am doing this to send the user to the oauth url:
RequestToken requestToken = twitter.getOAuthRequestToken();
String authorizationUrl = requestToken.getAuthorizationURL();
So then the user leaves my page, and comes back to my callback URL,
with an HTTP parameter called "oauth_token".
What do I do from there?
The examples say: accessToken = requestToken.getAccessToken();
But I don't have the requestToken object anymore.

How do I use "oauth_token" to either recreate that object, or get the
accesstoken
directly, but using the string instead of the object?

I would make a lot of sense that you should be able to "new"
RequestToken using a string, or something like that.

Thanks
Nathan


[twitter-dev] Re: Blocking vs non-blocking list creation: list streams are different

2009-11-10 Thread sathia nathan
>
> hi
>>
>   i have created 2 twitter in gmail account  and yahoo account but
i need same user name wat can i do. how it save same user name.

>
>> Cheers,
>> Eric
>>
>


[twitter-dev] Twitter4J OAuth for the web

2009-10-30 Thread Nathan

I am new to twitter and OAuth.
I've decided to try Twitter4J. They have good examples on their
website but it's mostly oriented toward Desktop/Mobile apps.
I'm building a web app, and I'm still not confident about the OAuth
process.
Are there good examples anywhere?

I think I'm supposed to do something like
RequestToken requestToken = twitter.getOAuthRequestToken();
Then send the user to :requestToken.getAuthorizationURL()
But then I'm not sure how to get his AccessToken back once he approves
my app.
Am I gonna get it back as an http request parameter or something?


[twitter-dev] Example OAuth app in Scala

2009-08-01 Thread Nathan

Hi guys. Could you add this command line OAuth Twitter client example
(Scala) to the OAuth Examples wikipage?
http://databinder.net/dispatch/Twine

There's also dispatch.twitter as a Scala Twitter library (src
http://databinder.net/sxr/dispatch-twitter/0.5.1/main/Twitter.scala.html)
but it may be better to wait on that until the interface is more
complete and I have a documentation page just for that Dispatch
module. Or maybe it's better to have a link up so people can figure
out what they can figure out; whatever you guys think is best!

Nathan