OAuth 2.0認証の設定 custom-channel-oauth2

このページでは、 トークンリクエストペイロード、資格情報パス、トークン抽出、配信リクエスト内のトークンの場所など、Adobe Journey Optimizerのカスタムチャネルに対するOAuth 2.0認証を設定する方法について説明します。

カスタムチャネル 🔗の作成中に​ OAuth 2.0 ​を認証タイプとして選択すると、Adobe Journey Optimizerが認証サーバーからアクセストークンを取得するために使用するトークンリクエストを設定します。

Journey Optimizerは、endpoint、method、request、policyの設定を使用してトークンリクエストを送信します。 次に、tokenPathを使用して応答からアクセストークンを抽出し、locationConfigを使用して配信リクエストに追加します。

OAuth 2.0認証ペイロードは、トークンエンドポイント​へのリクエストを設定します。 カスタムチャネル配信エンドポイントに送信される​ メッセージペイロード ​とは別です。

トークンリクエストの設定 token-request

以下の例を使用して、トークンリクエストを設定します。 エンドポイントと資格情報の値の例を、認証サーバーで必要な値に置き換えます。 例のheadersおよびqueryParams個のエントリはオプションです。トークン エンドポイントが必要でない場合はそれらを削除し、一致するエントリをcredentialPathsから削除します。

フォーム本文の例 form-body-example

トークンエンドポイントがgrant_type、client_id、client_secretなどのフォームフィールドを想定している場合は、form ペイロードを使用します。

{
  "type": "oauth2",
  "endpoint": {
    "uri": "https://auth.example.com/oauth/token"
  },
  "method": "post",
  "request": {
    "headers": [
      {
        "key": "sampleHeaderKey",
        "value": "sampleHeaderValue"
      }
    ],
    "queryParams": [
      {
        "key": "sampleQueryParamKey",
        "value": "sampleQueryParamValue"
      }
    ],
    "payload": {
      "type": "form",
      "content": [
        {
          "key": "grant_type",
          "value": "client_credentials"
        },
        {
          "key": "client_id",
          "value": "your-client-id"
        },
        {
          "key": "client_secret",
          "value": "your-client-secret"
        }
      ],
      "includeNullValues": false
    }
  },
  "response": {
    "type": "json"
  },
  "policy": {
    "timeoutInMilliseconds": 30000,
    "cache": {
      "enabled": true,
      "ttlInSeconds": 300
    },
    "retry": {
      "enabled": false,
      "maxRetryCount": 3
    }
  },
  "credentialPaths": [
    "header.sampleHeaderKey",
    "queryParam.sampleQueryParamKey",
    "payload.client_id",
    "payload.client_secret"
  ],
  "tokenPath": "access_token",
  "locationConfig": {
    "key": "Authorization",
    "location": "header"
  }
}

form ペイロードの場合、各資格情報パスは、フォームフィールドキー(例:payload.client_secret)を使用します。 資格情報パスにcontentまたは配列インデックスを含めないでください。

JSON本文の例 json-body-example

トークンエンドポイントがJSON リクエスト本文を想定している場合は、json ペイロードを使用します。

{
  "type": "oauth2",
  "endpoint": {
    "uri": "https://auth.example.com/oauth/token"
  },
  "method": "post",
  "request": {
    "headers": [
      {
        "key": "sampleHeaderKey",
        "value": "sampleHeaderValue"
      }
    ],
    "queryParams": [
      {
        "key": "sampleQueryParamKey",
        "value": "sampleQueryParamValue"
      }
    ],
    "payload": {
      "type": "json",
      "content": {
        "grant_type": "client_credentials",
        "client_id": "your-client-id",
        "client_secret": "your-client-secret"
      },
      "includeNullValues": false
    }
  },
  "response": {
    "type": "json"
  },
  "policy": {
    "timeoutInMilliseconds": 30000,
    "cache": {
      "enabled": true,
      "ttlInSeconds": 300
    },
    "retry": {
      "enabled": false,
      "maxRetryCount": 3
    }
  },
  "credentialPaths": [
    "header.sampleHeaderKey",
    "queryParam.sampleQueryParamKey",
    "payload.client_id",
    "payload.client_secret"
  ],
  "tokenPath": "access_token",
  "locationConfig": {
    "key": "Authorization",
    "location": "header"
  }
}

OAuth 2.0 フィールド oauth2-fields

フィールド
説明
type
oauth2 である必要があります。
endpoint.uri
OAuth 2.0 トークンエンドポイントのHTTPS URL。
method
トークンエンドポイントの呼び出しに使用されるHTTP メソッド。 トークン要求にpostを使用します。
request.headers
トークンエンドポイントに送信されるオプションのヘッダー。
request.queryParams
トークンエンドポイント URLに追加されるオプションのクエリパラメーター。
request.payload
トークンリクエスト本文。 formおよびjson ペイロードをサポートしています。
request.payload.includeNullValues
null値を持つフィールドをトークンリクエスト本文に含めるかどうかを定義します。
response.type
応答の形式: トークン エンドポイントがJSON応答を返す場合は、jsonを使用します。
policy.timeoutInMilliseconds
トークン エンドポイントの応答を待機する最大時間。
policy.cache
OAuth トークンがキャッシュされるかどうか、およびどのくらいの期間を定義します。
policy.retry
トークンエンドポイントの失敗に対するオプションの再試行設定。
credentialPaths
資格情報を含むリクエストフィールドへのパス。 これらのフィールドは認証情報として扱われ、安全に管理することができます。
tokenPath
OAuth応答のアクセストークンへのドット区切りパス(例:access_tokenまたはdata.access_token)。
locationConfig
取得したトークンを配信リクエストに追加する場所を定義します。
locationConfig.key
トークンを保持するヘッダーまたはクエリパラメーターの名前(例:Authorization)。
locationConfig.location
トークンが追加される場所:headerまたはqueryParam。

トークンキャッシュが有効になっている場合、Journey Optimizerは、配信リクエストごとにトークンエンドポイントを呼び出すのではなく、設定されたキャッシュ時間にOAuth トークンを再利用します。

資格情報フィールドの特定 credential-paths

credentialPathsを使用して、資格情報を含むリクエストフィールドを特定します。 ヘッダーまたはクエリパラメーターに資格情報が含まれている場合は、そのパスと資格情報パスをリクエスト本文に含めます。 上記の例では、ヘッダーとクエリパラメーターのサンプル値を資格情報として特定しています。このリストは、リクエストに合わせて調整してください。

接頭辞
に使用
例
header.
資格情報がリクエストヘッダーで渡されました。
header.sampleHeaderKey
queryParam.
クエリパラメーターに資格情報が渡されました。
queryParam.sampleQueryParamKey
payload.
リクエスト本文に資格情報が渡されました。
payload.client_secret

次のルールを適用します。

  • パスはheader、queryParamまたはpayloadで始まり、区切り記号としてドットを使用する必要があります。
  • form ペイロードの場合は、payload.<formFieldKey>を使用します。
  • json ペイロードの場合、payload.client_idやpayload.credentials.client_secretなどのJSON オブジェクトパスを使用します。 パスにcontentを含めないでください。
  • 空のパスセグメントはサポートされていません。 例:payload..client_idは無効です。

ネストされたJSON本文の場合は、次の設定抜粋に示すようにドット表記法を使用します。

{
  "request": {
    "payload": {
      "type": "json",
      "content": {
        "credentials": {
          "client_id": "your-client-id",
          "client_secret": "your-client-secret"
        }
      },
      "includeNullValues": false
    }
  },
  "credentialPaths": [
    "payload.credentials.client_id",
    "payload.credentials.client_secret"
  ]
}

アクセストークンの抽出 token-path

tokenPathは、アクセストークンがOAuth 2.0 トークン応答のどこにあるかを定義します。

次の応答の場合、tokenPathをaccess_tokenに設定します。

{
  "access_token": "example-access-token",
  "token_type": "Bearer",
  "expires_in": 3600
}

ネストされた応答の場合、tokenPathをdata.access_tokenに設定します。

{
  "data": {
    "access_token": "example-access-token"
  }
}

配信リクエストへのトークンの追加 token-location

locationConfigは、カスタム チャネル配信エンドポイントの呼び出し時に、Journey Optimizerが取得したトークンを追加する場所を定義します。

Authorization ヘッダーでトークンを送信するには、次を使用します。

{
  "locationConfig": {
    "key": "Authorization",
    "location": "header"
  }
}
ロケーション
説明
header
トークンをHTTP ヘッダーとして追加します。
queryParam
トークンをクエリパラメーターとして追加します。

制限と検証ルール limits

フィールド
上限
endpoint.uri
空でないホストを持つ絶対HTTPS URLである必要があります。 最大長:2048文字。
policy.timeoutInMilliseconds
最小:300 ミリ秒。 最大:60000 ミリ秒。
policy.cache.ttlInSeconds
キャッシュが有効な場合に適用されます。 最小値:300秒。 最大:3600秒。
request.headers
ヘッダーの最大数は50です。 ヘッダーキーの長さ:1 ~ 100文字。 ヘッダー値の最大値:8192文字。
request.queryParams
最大50個のクエリパラメーター。 クエリパラメーターキーの長さ:1 ~ 100文字。 クエリパラメーター値の最大値:8192文字。
request.payload.type=form
最大50個のフォームフィールド。 フォームキーの長さ:1~100文字。 重複するフォームキーは使用できません。
資格情報の値
1 ~ 1024文字。
tokenPath
有効なドット区切りパスである必要があります。 空の値は、応答全体がトークンである場合にのみ許可されます。
credentialPaths
header、queryParamまたはpayloadで始まり、区切り記号としてドットを使用する必要があります。

次の手順 next-steps

AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: Configure OAuth 2.0 authentication for a custom channel by defining the token endpoint request, identifying credential fields, extracting the access token from the response, and specifying where to add it to delivery requests.

Intents:

  • Configure OAuth 2.0 authentication when creating a custom channel or managing API credentials
  • Choose a form or JSON body for the token endpoint request
  • Identify credential fields in headers, query parameters, and request bodies
  • Extract an access token from a top-level or nested response field
  • Add the retrieved token to a delivery request header or query parameter
  • Understand token caching and authentication configuration limits

Glossary:

  • Token endpoint: The authorization server endpoint that Journey Optimizer calls to retrieve an access token
  • Authentication payload: The configuration of the OAuth 2.0 token request, separate from the message payload sent to the delivery endpoint (product-specific)
  • Credential paths: The paths identifying request fields that contain credentials, configured through credentialPaths (product-specific)
  • Token path: The dot-separated path to the access token in the token endpoint response, configured through tokenPath (product-specific)
  • Token location configuration: The delivery request header or query parameter to which the retrieved token is added, configured through locationConfig (product-specific)

Guardrails:

  • Set the authentication configuration type to oauth2 and use post for token requests.
  • The token endpoint must be an absolute HTTPS URL with a non-empty host and a maximum length of 2048 characters.
  • Token request bodies support form and json payloads; choose the format expected by your authorization server.
  • Credential paths must start with header, queryParam, or payload, use dots as separators, and contain no empty path segments.
  • Form credential paths use the form field key. JSON credential paths use the JSON object path. Do not include content or form array indexes in credential paths.
  • Supported token locations are header and queryParam.
  • The token endpoint timeout must be between 300 and 60000 milliseconds.
  • When token caching is enabled, the cache duration must be between 300 and 3600 seconds. Journey Optimizer reuses the token for the configured duration instead of retrieving a token for every delivery request.
  • Credential values must contain between 1 and 1024 characters.
  • An empty tokenPath is allowed only when the entire response is the token.

Terminology:

  • Canonical name: OAuth 2.0 authentication - variants: OAuth 2.0 authentication payload, OAuth token request configuration
  • Do not confuse: “authentication payload” (configuration for retrieving an access token) with “message payload” (content sent to the custom channel delivery endpoint)
  • Do not confuse: credentialPaths (credential fields in the token request) with tokenPath (access token field in the token response)
  • Do not confuse: request.headers and request.queryParams (values sent to the token endpoint) with locationConfig (where the retrieved token is added to delivery requests)

FAQ:

  • Q: When should I use a form or JSON payload? - Use form when the token endpoint expects form fields, and json when it expects a JSON request body.
  • Q: How do I identify a client secret in a form body? - Use the form field key, for example, payload.client_secret, without content or an array index.
  • Q: How do I identify credentials in a nested JSON body? - Use dot notation, for example, payload.credentials.client_secret.
  • Q: How do I extract a token from a nested response? - Set tokenPath to the response field path, for example, data.access_token.
  • Q: Where can Journey Optimizer add the token to delivery requests? - Set locationConfig.location to header or queryParam and locationConfig.key to the header or query parameter name.
  • Q: Does Journey Optimizer retrieve a token for every delivery request? - When caching is enabled, it reuses the token for the configured cache duration.
recommendation-more-help
journey-optimizer-help