ウェブサイト認証の更新
Web サイトの認証を更新してください。
アプリケーションを手動で再認証したり、既存のユーザー (販売者またはベンダー) にアプリケーションの新しいロールを承認させたりするには、OAuth ワークフローを設定する必要があります。再承認はセラーセントラルまたはベンダーセントラルで行われます。
To create a new authorization in your application, use the Selling Partner Appstore authorization workflow or Website authorization workflow.
ステップ1. アプリの管理ページから再認証する
-
セラーセントラルまたはベンダーセントラルにサインインして、次のページに移動します。 Manage Your Apps。
-
再認証するアプリケーションを探します。
-
Re-Authorizeを選択します。
-
アプリケーションによって要求されるデータアクセスを確認し、受け入れます。
-
Login to [your application name] nowを選択します。
Amazon は、次のクエリパラメータを使用してログイン URI (開発者アカウントからアプリクライアントを作成したときに提供) をブラウザにロードします。
パラメーター説明 amazon_callback_uri
ブラウザーをAmazonにリダイレクトするためのURI。 amazon_state
クロスサイトリクエストフォージェリ攻撃を防ぐためにAmazonが生成する状態値。 selling_partner_id
アプリケーションを認可している出品パートナーの識別子。
リクエストの例:
https://d2yzyfnnpjylxu.cloudfront.net/index.html?amazon_callback_uri=https://amazon.com/apps/authorize/confirm/amzn1.sellerapps.app.2eca283f-9f5a-4d13-b16c-474EXAMPLE57&amazon_state=amazonstateexample&selling_partner_id=A3FHEXAMPLEYWS
注
アプリケーションが入っている場合
DRAFT
ステータス、アマゾンには以下が含まれますversion=beta
URI にあります。
ステップ 2:Web サイトにサインインし、更新トークンを生成します。
-
Login with Amazon (LWA) 認証コードを使用して LWA 更新トークンを生成します。
注
You can use the Login with Amazon SDK for JavaScript to use an LWA authorization code to generate an LWA refresh token. For more information, refer to the Login with Amazon documentation.
Your application calls the LWA authorization server (https://api.amazon.com/auth/o2/token
), which uses the LWA authorization code to generate an LWA refresh token. The call must include the following query parameters:
パラメーター | 説明 |
---|---|
grant_type | リクエストされたアクセス許可のタイプ。authorization_code である必要があります。 |
code | Your LWA authorization code. |
redirect_uri | アプリケーションのリダイレクトURI。 |
client_id | Part of your LWA credentials. |
client_secret | Part of your LWA credentials. |
リクエストの例:
POST /auth/o2/token HTTP/l.l
Host: api.amazon.com
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
grant_type=authorization_code&code=SplxlOexamplebYS6WxSbIA&client_id=foodev&client_secret=Y76SDl2F
LWA 認証サーバーは LWA 更新トークンを返します。レスポンスには以下が含まれます。
パラメーター | 説明 |
---|---|
access_token | A token that authorizes your application to take certain actions on behalf of a selling partner. For more information, refer to Connecting to the Selling Partner API. |
token_type | 返されるトークンのタイプ(bearer である必要があります)。 |
expires_in | アクセストークンの有効期限が切れるまでの秒数。 |
refresh_token | A token that you can use to generate a new access token. For more information, refer to Connecting to the Selling Partner API. |
レスポンスの例:
{
"access_token": "Atza|IQEBLjAsAexampleHpi0U-Dme37rR6CuUpSR",
"token_type": "bearer",
"expires_in": 3600,
"refresh_token": "Atzr|IQEBLzAtAhexamplewVz2Nn6f2y-tpJX2DeX"
}
アプリケーションはrefresh_token
値を保存します。出品パートナー用の古いrefresh_token
は削除してください。ブラウザーは、アプリケーションを使用するための次のステップを示すページを開きます。
注
LWA更新トークンは、LWAアクセストークンの生成に使用できる長寿命のトークンです。このトークン生成によって取得したアクセストークンは、以下を除くすべての販売パートナーAPIオペレーションの呼び出しに含める必要があります。
アクセストークンは 1 時間後に期限切れになります。アクセストークンは、アクティブな間は複数の API 呼び出しに使用できます。
To generate a refresh token for an access token using a generated SDK, refer to Connecting to the Selling Partner API using a generated Java SDK. To manually generate a refresh token for an access token, refer to Connecting to the Selling Partner API.
ステップ 3:再承認ワークフローをテストしてください。
Visit the Manage Your Apps page within Seller Central or Vendor Central and choose the Re-Authorize button to start the reauthorization workflow. If you're testing your workflow with a trusted selling partner, make sure they log in to their selling partner account on Seller Central or Vendor Central and navigate to the Manage Your Apps page to initiate the workflow.
次のシナリオで再認証ワークフローをテストしてください。
- The seller or vendor is logged in to your website at Step 1.
- The seller or vendor is logged out of your website at Step 1.
注
アプリケーションの実行中に再認証ワークフローをテストすることをおすすめします。
Draft
ステータス:アプリケーションがパラメータを生成し、認証情報を受信できることを確認します。このワークフローが正しく設定されていないと、既存の販売者やベンダーが再認証を試みたときにアプリケーションにアクセスできなくなる可能性があります。
Updated 23 days ago