Oct 21, 2013 at 10:52 AM
Edited Oct 21, 2013 at 11:49 AM
I am quite not sure what you are willing to do.
The TokenCreator class manages the different steps a user requires to perform in order to accept your application with Twitter.
When the user has validated the requirements (entering the captcha on the twitter website) the TokenCreator will give you a Token that contains TokenCredentials.
You can store (look at Twitter conditions to learn what you can and cannot store) this information wherever you want.
If you are willing to store the User Id specifically you use the example called "GenerateToken".
Here is the example to meet your request :
public static void StoreUserId(long userId)
// You code to store it
public static void GenerateTokenAndSaveUserId(IToken consumerToken)
// Starting Token Generation...
ITokenCreator creator = new TokenCreator(consumerToken.ConsumerKey,
Console.WriteLine("Please enter the verifier key...");
IToken newToken = creator.CreateToken(GetCaptchaFromConsole);
if (newToken != null)
ITokenUser loggedUser = new TokenUser(newToken);
public static int GetCaptchaFromConsole(string validationUrl)
Console.WriteLine("Please visit :");
Console.WriteLine("\nEnter validation key : ");
string validationKey = Console.ReadLine();
if (Int32.TryParse(validationKey, out result))
Please have a look to this example and let me know if this helps you.