CredentialStore Sharing

Jan 29, 2015 at 7:41 AM
I have two console application for Stream User Messages and Stream Filtered Statuses. I am creating new Credential Store (SingleUserInMemoryCredentialStore) for each console application.. Also I need use that credential store in web application. When I try authorizing on web application another stream will be closed. Can I storing and sharing credential store object? Or you could give a suggestion if you have.

Thank you...
Coordinator
Jan 29, 2015 at 5:07 PM
Hi,

It's a good practice to store credentials for a user and then load them when the user logs back on. Since you have a few different applications, and one is a Web app, I think that saving the credentials in a database that all 3 applications can access would work.

BTW, you can't run a stream in a Web app - it's stateless and your connection closes on every request.

@JoeMayo
Jan 29, 2015 at 7:09 PM
JoeMayo wrote:
Hi,

It's a good practice to store credentials for a user and then load them when the user logs back on. Since you have a few different applications, and one is a Web app, I think that saving the credentials in a database that all 3 applications can access would work.

BTW, you can't run a stream in a Web app - it's stateless and your connection closes on every request.

@JoeMayo
Sorry my fault. I was very tired and sleepless. I do not run stream in web app, I send tweet and follow, unfollow in a Web app.

How can I store and restore Credentials with LinqToTwitter? Can you give more information?
Coordinator
Feb 1, 2015 at 7:40 PM
The Linq2TwitterDemos_Console project has a Program.cs file with the following info:
            await auth.AuthorizeAsync();

            // This is how you access credentials after authorization.
            // The oauthToken and oauthTokenSecret do not expire.
            // You can use the userID to associate the credentials with the user.
            // You can save credentials any way you want - database, isolated storage, etc. - it's up to you.
            // You can retrieve and load all 4 credentials on subsequent queries to avoid the need to re-authorize.
            // When you've loaded all 4 credentials, LINQ to Twitter will let you make queries without re-authorizing.
            //
            //var credentials = auth.CredentialStore;
            //string oauthToken = credentials.OAuthToken;
            //string oauthTokenSecret = credentials.OAuthTokenSecret;
            //string screenName = credentials.ScreenName;
            //ulong userID = credentials.UserID;
            //
@JoeMayo