PIN-based authorization |
PINベースOAuth フローは、ユーザーを認証エンドポイントへリダイレクトするためにウェブブラウザへアクセスや埋め込みができないアプリケーションを対象としています。 そうしたアプリケーションの例として、コマンドラインアプリケーション、埋め込みシステム、ゲームコンソール、特定のタイプのモバイルアプリがあります。
OverviewThe PIN-based OAuth flow is intended for applications which cannot access or embed a web browser in order to redirect the user to the authorization endpoint. Examples of such applications would be command-line applications, embedded systems, game consoles, and certain types of mobile apps. |
PINベースフローの実装は Implementing Sign in with Twitter や3つ足認証とほとんど同じですが、POST oauth / request_tokenを呼び出している間はoauth_callback
の値にoob
を設定しなければならないという一点のみ違いがあります。
アプリケーションが GET oauth/authenticate か GET oauth/authorize URLのいずれかを取得したら、そのURLをユーザーに表示してユーザーがウェブブラウザを使ってTwitterにアクセスできるようにします。
oob
コールバックがリクエストされたユーザーがTwitterへ行った場合、アクセス承認時にユーザーがアプリケーションへ自動的にリダイレクトされることはありません。
その代わり、ユーザーには「アプリケーションに戻ってこの値を入力してください」という説明と共にPINコードが表示されます。
あなたのアプリケーションは、ユーザーがこのPINコードを入力してフローを完了できるようにしなければなりません。PINコードはPOST oauth/access_tokenリクエストのoauth_verifier
の値として必ず設定してください。こうして他の全てのリクエストが正常に動作するようになります。
ImplementationThe PIN-based flow is implemented in the same exact way as Implementing Sign in with Twitter and 3-legged Authorization, with the only difference being that the value for Once your application has obtained either a GET oauth/authenticate or GET oauth/authorize URL, display the URL to the user so that they may use a web browser to access Twitter. When an ![]() Your application must allow the user to input this PIN to complete the flow. The PIN code must be passed as the value for |