ウェブサイト認証の更新

Web サイトの認証を更新してください。

アプリケーションを手動で再認証したり、既存のユーザー (販売者またはベンダー) にアプリケーションの新しいロールを承認させたりするには、OAuth ワークフローを設定する必要があります。再承認はセラーセントラルまたはベンダーセントラルで行われます。

To create a new authorization in your application, use the Selling Partner Appstore authorization workflow or Website authorization workflow.

ステップ1. アプリの管理ページから再認証する

  1. セラーセントラルまたはベンダーセントラルにサインインして、次のページに移動します。 Manage Your Apps

  2. 再認証するアプリケーションを探します。

  3. Re-Authorizeを選択します。

  4. アプリケーションによって要求されるデータアクセスを確認し、受け入れます。

  5. 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 サイトにサインインし、更新トークンを生成します。

  1. Sign in to your website.

  2. Amazon sends you the authorization information.

  3. 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である必要があります。
codeYour LWA authorization code.
redirect_uriアプリケーションのリダイレクトURI。
client_idPart of your LWA credentials.
client_secretPart 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_tokenA 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_tokenA 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 ステータス:アプリケーションがパラメータを生成し、認証情報を受信できることを確認します。このワークフローが正しく設定されていないと、既存の販売者やベンダーが再認証を試みたときにアプリケーションにアクセスできなくなる可能性があります。


このページは役に立ちましたか?