Dave
Dave

Reputation: 477

How to get the "oauth_token" for the authorize url in PIN-based OAuth flow for Twitter API?

The logic looks circular to me(although I know I'm missing something)

I want to use this:

https://dev.twitter.com/docs/auth/pin-based-authorization

But in order to make the url to send the user to get the pin you need an "oauth_token" :

https://dev.twitter.com/docs/api/1/get/oauth/authorize

But to get the "oauth_token" you need a:

https://dev.twitter.com/docs/api/1/post/oauth/request_token

But that at the bottom shows it needs an "oauth_signature"

Well, an "oauth_signature" requires an "oauth_token" ( https://dev.twitter.com/docs/auth/creating-signature ) which you don't have, making impossible to get an "oauth_token" because you need one to get one.

What am I missing here? I mainly just want to find out how to get that initial url for the PIN-based authorization, so I need that first "oauth_token" somehow.

Upvotes: 2

Views: 8093

Answers (2)

user4837956
user4837956

Reputation:

set the callback URL both https://apps.twitter.com/ and in your code . It is working for Me.

oauthCallback:@"myapp://twitter_access_tokens/"

Upvotes: 0

Tom van der Woerdt
Tom van der Woerdt

Reputation: 29965

There are two different types of oauth tokens - let's call them request tokens and normal tokens. Request tokens are used for the authentication, then once the authentication is done you get normal oauth tokens.

Calling oauth/request_token will generate a request token for you, which is a temporary token used for the actual authentication. Once that's done you have the normal tokens.

Upvotes: 1

Related Questions