Login with twitter and post tweet on behalf of user

There are several steps you need to take to connect to the networks and post on behalf of your users, or to any of the social networks.

  1. Apply for approval to access the API and get an approved app on the social network. This varies per network from fast (Reddit) to long (Facebook with screencasts, scope permissions, etc).
  2. Once you have approval to use the API, you need to integration authentication. This is usually some form of OAuth2. Basically you’ll be opening a new tab/window with your credentials given by the network, users will login into the network and grant you permission, and you’ll get a code back that you will exchange for a token. Store this access token in a secure location. Each network has different limits and lifetimes for the token, so be sure the check that. Finally, when you make the code<>token exchange always do it on the server-side or you’ll expose your social network secret key.
  3. With the access token you can start posting on your users’ behalf using the social network’s API. Depending upon your programming language there are packages/modules for some networks that might make life easier. Generally, I’ve found they aren’t maintained too well and it is easier to just use the REST calls.
  4. Be sure to follow the guidelines of the networks or you and your users will be banned. For example twitter.

You can also try our Ayrshare Bubble Plugin that connect to all the networks for you, so you can send on behalf of users.