Hi there,

Sorry you're having trouble -- I think it's because you're manipulating the
OAuth flow in a way that is completely at odds with the specification.

The PIN code is meant to be entered by the end user by hand -- consuming the
PIN code using tricks like this is fragile, against the spirit of OAuth, and
incredibly unrecommended.

You should in no way be interpreting any of the OAuth HTML pages -- whether
by automating the passing of user credentials to the login form, automating
the submission of the form, or automating the collection of a PIN code.

Not a single part of the OAuth sequence should be automated in any way shape
or form.

By automating this flow, you bring into question the authenticity of any
access tokens belonging to your application.

@episod <http://twitter.com/episod> - Taylor Singletary


On Fri, Apr 29, 2011 at 11:36 AM, Gustavo Bergamo <bergamo.gust...@gmail.com
> wrote:

> Hey all...
> I just join the group and it's my first mail.
>
> My, problem: Every time that I will login in twitter, in background
> appear a PIN number, and something like: "back to your application a
> enter this number", in my application I have this code to get the PIN
> number:
>
> [code]
> NSString                        *js = @"var d =
> document.getElementById('oauth-pin'); if (d
> == null) d = document.getElementById('oauth-pin'); if (d) d =
> d.innerHTML; if (d == null) {var r = new RegExp('\\\\s[0-9]+\\\\s'); d
> = r.exec(document.body.innerHTML); if (d.length > 0) d = d[0];}
> d.replace(/^\\s*/, '').replace(/\\s*$/, ''); d;";
>        NSString                *pin = [webView
> stringByEvaluatingJavaScriptFromString:
> js];
> [/code]
>
> I just change one thing in code that I download... I change
> "oauth_pin" to "oauth-pin", I see a lot of blog in the web to do
> this...
>
> How can I do, to start using the application?
>
> Thank you!
>
> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to