Ok, so I've currently implemented Facebook login in my app the following way:
I use the official FB framework to login the user. When I login, I get a authentication token, which is sent to my server. I then do another verification of the user (e.g. get "me" from Facebook, using the auth-token), and then return 32 char random key, which is used to identify the user in subsequent API-calls (to my server). An example.
I'm trying to figure out how to do the same with twitter, but I can't understand how to get the oath token in iOS? I have the server-side part working in another app, but no token to verify...
Please advice – is this (the FB way) how I should be doing this, or how would you go about the verification process?
Try logging out of your Twitter account and logging back in. You should then receive a verification PIN via SMS. If this doesn't resolve your issue, send a text message from your device with the message content, GO, to the Twitter short code 40404.
Intentionally or Unintentionally, when you use your account in a certain way, Twitter considers your account to be automated and logs you out. This is when Crowdfire will ask you to 'Re-authenticate' your account. Use the Twitter native app / website often to make new posts and interact with your followers.
In the email we send, clicking the Confirm now button lets us know the email address is yours. Log in to the email inbox for the address you just updated. Open the email from Twitter inviting you to confirm your account. Tap the Confirm now button in that email.
Sean Cook, engineer @ Twitter has a github repo with a simple app that do exactly what you are trying to do, I'using this code in my app and it works like a charm.
There's a good article at dev.twitter.com describing exactly that. Basically you'll have to first get a special request token by setting the x_auth_mode parameter to the value reverse_aut and then get the proper access token by sending what you got in the first step as x_reverse_auth_parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With