Twitter OAuth Flow - Confused about oob/3-legged auth and general flow, don't need PIN?

戏子无情 提交于 2019-12-05 20:56:07

Am I doing a 3-legged oAuth or an OOB oAuth?

You are doing both. 3-legged means you are involving a user, 2-legged is business to business, or service to service. OOB (Out of band) means that you automatically trigger the PIN-based authentication scheme. Basically this means that you are saying that you cannot receive the normal oauth_verifier parameter without the user manually entering it as a PIN.

Why would I need the PIN then?

You get the PIN because you are stating your callback as OOB. If you set up a real callback you can instead receive the oauth_verifier directly to your application.

How am I supposed to use the PIN correctly (if I need it)?

You use it in the next step, when exchanging the request token for an access token you pass it along in the request as the oauth_verifier.

How am I supposed to authenticate without the PIN (if I DON'T need it)?

You need the PIN, or if you use a real callback, the oauth_verifier. They are the same thing, the only difference is that the PIN gets printed on the screen so a user can copy-paste it into your application, while the oauth_verifier is automatically picked up by your application.

How do I make it so that users won't always see the PIN page after authenticating one time? I could put a callback in the very first request, but what if I don't want the user to get redirected to ANY page at all?

You use a real callback that intercepts and uses the oauth_verifier.

-If I have logged in during the second code segment and have been directed to the PIN page, but then chose NOT to enter the PIN/enter some wrong PIN into my application, I still get successfully authenticated and can get the final tokens without any problems. Why?

This simply cannot be true. There must be a good reason for this, perhaps your app already has an access token and simply uses it?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!