What is this PIN thats been requested?


#1

hi! i am using yusuke’s twitter4j and it is asking me for a PIN which i do not know what it is.

besides the consumer key, access token is there anything else im leaving out?


#2

Hi,

One method of authenticating via OAuth is called out-of-band (OOB). Instead of redirecting a user to a callback URL this method of OAuth instead displays a pin code for the user to input into an application. It sounds like this is the pin code being referred to.

If you already have an oauth_token and oauth_secret for your account this step shouldn’t be necessary though.

When are you being asked for the pin?


#3

im using his example to post “hello twitter” to my twitter, it is my own account and it is only one account that i am posting to

when i run it via updateStatus.cmd itll do its thing then it asks me for the PIN but i have already put the access token, access token secret, consumer key, consumer secret in the properties file though.


#4

oh i finally got it to work…

but it seems like every time i run the code itll ask me to go to:
http://api.twitter.com/oauth/authorize?oauth_token=L-------------------------------------------------u to get the PIN number, is there any way to get around that? without getting the PIN? because i am trying to do automated tweets using a crontab and i think this might be a problem.


#5

Our OAuth implementation only needs you to go through the authorization step once. The code you’re using is an end-to-end example. To be used in a crontab, you’ll need to write your own program that will re-use the credentials that you initially negotiate instead of renegotiating the credentials each time as the example code in Twitter4J is demonstrating.


#6

is there a way to post without the PIN?


#7

also, i have the access token already saved as both a string AND in the properties file, isnt that enough?


#8

You don’t need a PIN to post. The PIN code is only used during the token negotiation step when initially getting your access token. From that point forward, the PIN/oauth_verifier is meaningless and can be thrown away and forgotten about forever (or until the next time you need to obtain an access token).

I don’t know how the code you’re writing/executing necessarily works. I do know that Twitter4J works for many people but that you’ll need to do some programming to get it to work for your use case.


#9

ok sorry for sounding stupid but to POST all i need is my consumer key, consumer secret, access token, and access token secret?


#10

There’s many variables to all this so it’s easy to get mixed up.

Yes, you just need a consumer secret, access token, and access token secret permissioned for RW to post.


#11

i have the same problem…i need the permanent authorization with twitter … if it is possible? how to get it please help me…


#12

its not necessary to always go to the site to get the PIN as it is not needed

ill post my working solution to post to twitter when i get to work


#13

wait, are you using the example from yusuke github? cause all you have to do is have a twitter4j.properties file and all the information will be stored there without needing a PIN to post to your twitter.


#14

How do you stop the Twitter OAuth from even asking a user for that pin once they have Authorized your app? It is very ugly and since it doesn;'t do anything, why have it?


#15

pin is not needed though… if you are using the demo yusuke put up on github u just have to change it up a bit to avoid the pin…

i set up the credentials via configuration

// set credentials for twitter account
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true) .setOAuthConsumerKey(twitterAccountInfo.getConsumerKey())
.setOAuthConsumerSecret(twitterAccountInfo.getConsumerSecret())
.setOAuthAccessToken(twitterAccountInfo.getAccessToken())
.setOAuthAccessTokenSecret(twitterAccountInfo.getAccessSecret());

TwitterFactory factory = new TwitterFactory(cb.build());
Twitter twitter = factory.getInstance();

im able to tweet through my java file without using a pin


#16

how do I get my PIN? For authorization.


#17

thanks, I’ll try it


#18

Can anybody please explain me how to prevent checking for callback url in android? Because in android I know it is necessary to enter the callback url. But am doing a mimic of iPhone where callback url is not permitted. So any answer on this?


#19

Hi

i have a issue where after logging into twitter , i get step of authentication process where its showing a pin of 7 digits, so where should i authenticate the pin or may be how shud i use the pin or do i have a mechanism to bypass pin request authentication…


#20

yes how do i get my pin