My web application would send tweets on users' behalf. After getting the token through the Oauth process, I can think of 2 ways to post the tweet:
Which way is the best way to go? Pros and cons?
To answer my own question after a bit of investigation:
For a web application, the Oauth token is generally preserved on the server, and REST APIs are also called from server side. The calls can be made synchronously, so task queue is not necessarily needed.
For a native app, Oauth is generally handled within the app. A webview is used to load the authenciation URI, and when it redirects, the access code is captured in the URL. The access code is used by the app to obtain the access token.
For native apps, there is another authentication method generally referred to as SSO. It switches to the service provider's native app, and let user grant acces there, then switching back to your app. This is more convenient for the user, as the native client is almost always in logged-in state, saving the user from typing in username and password. However, this approach cannot be used by web applications.
Hope this helps someone. Correct me if I am wrong.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.