Simple user log in

Aug 5, 2014 at 8:17 AM
I am creating an app that requires the user to log into their twitter account.

I am having trouble with that since I see no clear way to do that in the documentation.

I need to have the user log in so they can follow other users, etc.
Coordinator
Aug 5, 2014 at 10:52 AM
Hi,

Are you sure you are not referencing the following documentation?

Linvi
Aug 5, 2014 at 2:48 PM
I have used that to allow my applications to be registered with twitter, I just must be missing some obvious when it comes to using it for user log in.

I want users to be able to just enter their username and password to log in.
Aug 5, 2014 at 5:01 PM
Edited Aug 5, 2014 at 5:10 PM
ezraza wrote:
I have used that to allow my applications to be registered with twitter, I just must be missing some obvious when it comes to using it for user log in.

I want users to be able to just enter their username and password to log in.
Having literally just written the code for this for a web application, here is some information..

The user will need to authenticate with Twitter using oAuth 1.0a - the process is something like:
  1. User presses "Sign in with Twitter" button
  2. User is taken to Twitter authentication page where they sign in
  3. User is returned to the callback URL specified on the app's settings page
  4. Application receives user's credentials which can be used to perform various actions (i.e. get the user's profile details, perform actions as that user etc)
MVC example: http://tweetinvi.codeplex.com/workitem/2334

WebForms example: https://tweetinvi.codeplex.com/discussions/536895

If you do not want to use the standard Twitter web interface in your app, I am sure there is some way you can code your own login page, but the request flow will have to involve some of the steps above. Hopefully the examples above will give you some idea of what's involved.

See http://oauth.net/core/1.0/#anchor9 for more info.
Coordinator
Aug 5, 2014 at 5:19 PM
Adaam gave some good information.
You can also find some information in the documentation here.

Linvi
Aug 5, 2014 at 10:26 PM
So I think I have the log in working.

My only issue is to get it working within a WPF application.

I will keep working at it and let you all know if I get it done.

Thanks!
Coordinator
Aug 6, 2014 at 9:33 AM
Edited Aug 6, 2014 at 9:35 AM
Hello there,

Please feel free to use the examples provided in the CheatSheet.cs.
Here is how to create credentials from a console application.
private static IOAuthCredentials CredentialsCreator_WithCaptcha_StepByStep(string consumerKey, string consumerSecret)
{
    var applicationCredentials = CredentialsCreator.GenerateApplicationCredentials(consumerKey, consumerSecret);
    var url = CredentialsCreator.GetAuthorizationURL(applicationCredentials);
    Console.WriteLine("Go on : {0}", url);
    Console.WriteLine("Enter the captch : ");
    var captcha = Console.ReadLine();

    var newCredentials = CredentialsCreator.GetCredentialsFromVerifierCode(captcha, applicationCredentials);
    Console.WriteLine("Access Token = {0}", newCredentials.AccessToken);
    Console.WriteLine("Access Token Secret = {0}", newCredentials.AccessTokenSecret);

    return newCredentials;
}
Linvi
Dec 16, 2014 at 11:10 AM
I have no idea about the captcha,what does it means,please help me.thank you !
Coordinator
Jan 7, 2015 at 8:19 AM
The captcha is a set of numbers provided by Twitter on its Website that a user is required to provide to your application in order to complete the login process.
There are 2 ways to authenticate. Either by using the captcha authentication or the URL redirect authentication.

Linvi