基本認証

基本認証は、アカウントのユーザー名とアカウントのパスワードを組み合わせてアプリケーションにアクセスできる認証タイプです。

基本認証の例を表示
{
  "name": "Basic Authentication",
  "type": "BasicAuthentication",
  "spec": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "description": "defines auth params required for connecting to rest service.",
    "properties": {
      "username": {
        "description": "Username to connect rest endpoint.",
        "type": "string"
      },
      "password": {
        "description": "Password to connect rest endpoint.",
        "type": "string",
        "format": "password"
      }
    },
    "required": [
      "username",
      "password"
    ]
  }
}
プロパティ説明例
authSpec.nameサポートされている認証タイプの名前を表示します。Basic Authentication
authSpec.typeソースでサポートされる認証のタイプを定義します。BasicAuthentication
authSpec.spec認証のスキーマ、データタイプ、プロパティに関する情報が含まれます。
authSpec.spec.$schema認証に使用するスキーマを定義します。http://json-schema.org/draft-07/schema#
authSpec.spec.typeスキーマのデータタイプを定義します。object
authSpec.spec.description認証タイプに固有の詳細情報を表示します。
authSpec.spec.properties認証に使用される資格情報に関する情報が含まれます。
authSpec.spec.properties.usernameアプリケーションに関連付けられているアカウントユーザー名。
authSpec.spec.properties.passwordアプリケーションに関連付けられているアカウントパスワード。
authSpec.spec.requiredExperience Platformで入力する必須の値として必須フィールドを指定します。username

API キー認証

API キー認証は、リクエストにAPI キーやその他の関連する認証パラメーターを提供することで、APIにアクセスするための安全な方法です。 特定のAPI情報に応じて、リクエストヘッダー、クエリパラメーター、本文の一部としてAPI キーを送信できます。

API キー認証を使用する場合、通常、次のパラメーターが必要です。

パラメータータイプ必須説明
host文字列×リソース URL。
authKey1文字列○API アクセスに必要な最初の認証キー。 通常、リクエストヘッダーまたはクエリパラメーターで送信されます。
authKey2文字列オプション2番目の認証キー。 必要に応じて、このキーはリクエストをさらに検証するためによく使用されます。
authKeyN文字列オプション必要に応じて使用できる追加の認証変数ですが、APIです。
API キー認証の表示
{
  "name": "API Key Authentication",
  "type": "KeyBased",
  "spec": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "description": "Define authentication parameters required for API access",
    "properties": {
      "host": {
        "type": "string",
        "description": "Enter resource URL host path"
      },
      "authKey1": {
        "type": "string",
        "format": "password",
        "title": "Authentication Key 1",
        "description": "Primary authentication key for accessing the API",
        "restAttributes": {
          "headerParamName": "X-Auth-Key1"
        }
      },
      "authKey2": {
        "type": "string",
        "format": "password",
        "title": "Authentication Key 2",
        "description": "Secondary authentication key, if required",
        "restAttributes": {
          "headerParamName": "X-Auth-Key2"
        }
      },
      ..
      ..
      "authKeyN": {
        "type": "string",
        "format": "password",
        "title": "Additional Authentication Key",
        "description": "Additional authentication keys as needed by the API",
        "restAttributes": {
          "headerParamName": "X-Auth-KeyN"
        }
      }
    },
    "required": [
      "authKey1"
    ]
  }
}

認証動作

restAttributes パラメーターを使用して、API キーをリクエストに含める方法を定義できます。 例えば、次の例では、headerParamName属性は、X-Auth-Key1をヘッダーとして送信する必要があることを示しています。

  "restAttributes": {
      "headerParamName": "X-Auth-Key1"
  }

各認証キー(authKey1、authKey2など) restAttributesに関連付けて、リクエストとして送信する方法を指定できます。

authKey1に"headerParamName": "X-Auth-Key1"がある場合。 つまり、リクエストヘッダーにはX-Auth-Key:{YOUR_AUTH_KEY1}を含める必要があります。 さらに、キー名とheaderParamNameは必ずしも同じである必要はありません。 次に例を示します。

  • authKey1にはheaderParamName: X-Custom-Auth-Keyを指定できます。 つまり、リクエストヘッダーではauthKey1ではなくX-Custom-Auth-Keyが使用されます。
  • 逆に、authKey1にはheaderParamName: authKey1を指定できます。 つまり、リクエストヘッダー名は変更されません。

API形式の例

GET /data?X-Auth-Key1={YOUR_AUTH_KEY1}&X-Auth-Key2={YOUR_AUTH_KEY2}

認証仕様の例

次に、MailChimp Members ソースを使用して完了した認証仕様の例を示します。

認証仕様の例を表示
  "authSpec": [
    {
      "name": "OAuth2 Refresh Code",
      "type": "OAuth2RefreshCode",
      "spec": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "description": "Define auth params required for connecting to generic rest using oauth2 authorization code.",
        "properties": {
          "authorizationTestUrl": {
            "description": "Authorization test url to validate accessToken.",
            "type": "string"
          },
          "accessToken": {
            "description": "Access Token of mailChimp endpoint.",
            "type": "string",
            "format": "password"
          }
        },
        "required": [
          "accessToken"
        ]
      }
    },
    {
      "name": "Basic Authentication",
      "type": "BasicAuthentication",
      "spec": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "description": "defines auth params required for connecting to rest service.",
        "properties": {
          "username": {
            "description": "Username to connect mailChimp endpoint.",
            "type": "string"
          },
          "password": {
            "description": "Password to connect mailChimp endpoint.",
            "type": "string",
            "format": "password"
          }
        },
        "required": [
          "username",
          "password"
        ]
      }
    }
  ],

次の手順

認証仕様を入力したら、Experience Platformに統合するソースのソース仕様の設定に進みます。 詳しくは、​ ソース仕様の設定に関するドキュメントを参照してください。

自動翻訳
言語セレクターを使用して、このページの英語版を表示します。
翻訳は役に立ちましたか?

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.