how to implement Twitter 3-legged authorization with tweetinvi

Dec 20, 2014 at 5:44 PM
Edited Dec 20, 2014 at 6:41 PM
I am looking same code to implement Twitter 3-legged authorization with tweetinvi for a Window Store App (not website)?

please help. thanks
Editor
Dec 21, 2014 at 4:49 PM
Hi,

Have you seen the ExampleInvi project for GenerateCredentials examples? I'm not sure about windows store app but that could help you figure things out.

https://tweetinvi.codeplex.com/SourceControl/latest#Development - 0.9.4.x/Examplinvi/Program.cs

imlokesh
Dec 21, 2014 at 6:12 PM
Hi imlokesh,

I actually cant understand this whole process, if it is Windows Store app.
I think maybe I should
1: add a webview control to direct user to twitter login page with callback URL to api.twitter.com/oath/authorize, and app credentials as well as oath_token?
2: once the user finish login, I assume the webview control( i.e, my store app ) will get access token and access secret.
3: from here pop a button in webview control to ask user to authorize app.
4:after that, it is fully authorized, and the process is done.

But I am not sure, if it is the right approach, also how to pass on the needed parameters/headers correctly with tweetinvi for each step.

Hope someone can point me the right direction before holiday.

Thanks.
Dec 27, 2014 at 4:44 PM
It is quite a complicated procedure, but I just implemented it manually.

1) request a request token
2) use this request token to log the user in
3) after user logged in, user has to authorise the app
4) after authorisation, exchange the request token for an access token (this stage isn't documented well / at all)
5) use your access oauth token and oauth_secret to perform twitter actions.

@ #5 it doesn't help a lot of places refer to this as either the same terms as in #1 (request oauth != access oauth) or as something different altogether
Dec 28, 2014 at 1:03 AM
martin,

thank you for reply.

So you did not use tweetinvi?

Part of my project using tweetinvi, if try to implement with you way, it will be more work to do.

Is your project a Store app? or web based?
if store app, can tell me how to handle the callback thing, I have hard time to understand it.

Thanks
Dec 28, 2014 at 12:27 PM
I did not use tweetinvi for the authorisation, I have reasons for wanting to do it all manually. But once I have the access oauthtoken and the access oauthtokensecret, I set the credentials in tweetinvi and use tweetinvi for performing the twitter actions.
Is your project a Store app? or web based?
Neither, just an old fashioned windows desktop app

if store app, can tell me how to handle the callback thing, I have hard time to understand it.
as I said, it isn't a windows store app, but I would a imagine a callback, is just a method that gets called later, like an action or a func?