1. 認証

ベアラートークン認証

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

SitecoreはCommerce Engineを直接呼び出すすべてのシステムに対してベアラートークン認証を使用します。呼び出し者はSitecoreの認証情報を使い、Sitecore Identityサーバーに接続してトークンを取得しなければなりません。例えば、Commerce Engine Connectのような既知のクライアントはクライアントトークンを要求しなければなりません。Sitecoreはリクエストヘッダーの認証ベアラーとしてこれらの認証トークンを使用します。

Commerce Engineのconfig.jsonファイルのSitecoreIdentityServerUrlパラメータで、Sitecore IdentityサーバーのURLを指定する必要があります。

Sitecore Identityサーバーは、トークン取得のための以下の2つのエンドポイントを提供します:

  • GetToken (http://{{SitecoreIdentityServerHost}}/connect/token)

    UIからログインせずにトークンを取得できるサイレントモードです。これはPostman、コンソール、デプロイスクリプトでリクエストを認証するために使われます。

  • Authorize (http://{{SitecoreIdentityServerHost}}/connect/authorize)

    Sitecore Identityのログインページを読み込みます。ユーザーがSitecore認証情報でログインすると、ユーザーは元のウェブサイトに戻されます。例えば、Sitecore XC Business Toolsユーザーの認証方法はこれです。

Commerce Engineを呼び出すシステム(例

、Commerce Business Tools、またはCommerce Engine Connect)の識別名は、Sitecore.Commerce.IdentityServer.Host.xml設定ファイルに保存されなければなりません。XML設定ファイルのデフォルト位置はC:\inetpub\wwwroot\\Config\production\Sitecore.Commerce.IdentityServer.Host.xmlです。

Postmanクライアント認証の設定例

以下は、PostmanクライアントのSitecore Identityサーバー Sitecore.Commerce.IdentityServer.Host.xmlファイルにおけるデフォルトのクライアント構成の例を示しています:

postman-api Postman API 0 true false 3600 3600 true false false password {AllowedCorsOrigin}/oauth2/callback {AllowedCorsOrigin} https://www.getpostman.com openid EngineAPI postman\_api true

Business Toolsクライアント認証の設定例

以下はSitecore XC Business ToolsのSitecore.Commerce.IdentityServer.Host.xmlにおけるクライアント構成の例です。

CommerceBusinessTools CommerceBusinessTools 0 true false 3600 3600 true false false implicit {AllowedCorsOrigin} {AllowedCorsOrigin} http://localhost:4200|https://localhost:4200|http://localhost:5005|https://localhost:5005 openid dataEventRecords dataeventrecordsscope securedFiles securedfilesscope role EngineAPI true

Commerce Engine Connectクライアント認証の構成例

以下はCommerce Engine ConnectクライアントのSitecore.Commerce.IdentityServer.Host.xmlにおけるデフォルトのクライアント設定の例を示しています。

CommerceEngineConnect CommerceEngineConnect 0 true false 3600 3600 true false true client\_credentials {AllowedCorsOrigin}/oauth2/callback {AllowedCorsOrigin}/PostLogoutRedirectUri1> HOSTNAME openid sitecore.profile sitecore.profile.api EngineAPI true CLIENTSECRET
この記事を改善するための提案がある場合は、 お知らせください!