[AEM Forms]{class="badge positive" title="AEM Formsに適用)。"}

OAuth サーバー間認証

OAuth Server-to-Server Authenticationにより、ユーザーの操作を必要とせずに、AEM Forms Communications APIへのトークンベースの安全なアクセスが可能になります。 OAuth サーバー間認証は、Adobe Developer Consoleでサポートされています。

前提条件

開始する前に、次の前提条件が満たされていることを確認してください。

OAuth サーバー間認証を使用してアクセストークンを生成する方法を教えてください。

次の手順に従って、Adobe Developer コンソールからアクセストークンを生成し、OAuth Server-to-Server Authenticationを介して最初のAPI呼び出しを行います。

​1. Adobe Developer Console プロジェクト設定

  1. Adobe Developer Consoleに移動します

  2. Adobe IDでログイン

  3. 新規プロジェクトを作成するか、既存のプロジェクトに移動します

新しいプロジェクトを作成するには
  1. クイックスタート セクションで、新規プロジェクトの作成​をクリックします

  2. 新しいプロジェクトがデフォルト名で作成されます

    ADC プロジェクトの作成

  3. 右上隅の「プロジェクトを編集」をクリックします

    プロジェクトを編集

  4. 意味のある名前を指定します(例:「formsproject」)。

  5. 保存」をクリックします。

    プロジェクト名を編集

既存のプロジェクトに移動するには
  1. Adobe Developer Consoleから​ すべてのプロジェクト ​をクリックします

    プロジェクトを検索

  2. プロジェクトを見つけて、クリックして開きます。

    プロジェクトの検索

​2. Forms APIの追加

次の操作に基づいてForms APIを追加します。

  • AEM Forms Communications API:ドキュメント(PDFおよび関連する形式)の生成、変換、組み立て、またはセキュリティ保護が必要な場合に使用します。
  • アダプティブ Forms ランタイム API – 実行時にアダプティブ Formsをレンダリング、送信、処理する必要がある場合に使用します。
AEM Forms Communications APIの場合
  1. APIを追加」をクリックします

    Apiを追加

  2. Forms Communication API​を選択

    1. Add API ダイアログで、Experience Cloud​でフィルタリングします

    2. 「Forms Communication API」を選択

      Forms Communication APIを追加

    3. 次へ」をクリックします。

    4. OAuth サーバー間​認証方法を選択

      認証方法を選択

アダプティブ Forms ランタイム APIの
  1. 「APIを追加」をクリック

    Apiを追加

  2. AEM Forms Delivery and Runtime APIを選択

    1. Add API ダイアログで、Experience Cloud​でフィルタリングします

    2. 「AEM Forms Delivery and Runtime API」を選択
      Forms Communication APIを追加

    3. 次へ」をクリックします。

    4. OAuth サーバー間​認証方式を選択します。
      認証方法を選択

You can also add the API and authentication method to your existing project by clicking Add to Project > API
Add API to existing Project

3. Add Product Profile

Product profile provides permissions (or authorization) for credentials to access the AEM resources.

  1. Select the Product Profile that matches your AEM instance URL (https://Service Type -Environment Type-Program XXX-Environment XXX.adobeaemcloud.com).

    • Service Type – specifies services or permissions associated with the AEM instance

    • Environment Type – specifies whether the envrionment is for Author or Publish service

    • Program XXX – identifies the Cloud Manager program ID

    • Environment XXX – identifies the specific environment ID within that program

    note note
    NOTE
    Product profiles are tied to a specific AEM instance (program + environment). Always choose the profile that matches your instance URL.
  2. 設定済み API を保存」をクリックします。 The API and Product Profile are added to your project

    Select Project Configuration

4. Generate and Save Credentials

  1. Navigate to your project in Adobe Developer Console

  2. Click OAuth Server-to-Server credential

  3. View the Credential details section

    資格情報の表示

Record API Credentials

    API Credentials:
    ================
    Client ID: <your_client_id>
    Client Secret: <your_client_secret>
    Technical Account ID: <tech_account_id>
    Organization ID: <org_id>
    Scopes: AdobeID,openid,read_organizations

5. Access Token Generation

Generate the Access token either manually or programmatically:

For Testing

Generate access tokens manually in Adobe Developer Console:

  1. Navigate to your Project

    1. In Adobe Developer Console, open your project
    2. Click OAuth Server-to-Server
  2. アクセストークンを生成

    1. プロジェクトのAPI セクションで「"アクセストークンを生成"」ボタンをクリックします
    2. 生成されたアクセストークンをコピー

    アクセストークンを生成

    note note
    NOTE
    アクセストークンは​ 24時間 ​のみ有効です
実稼動用

Adobe IMS APIを使用してプログラムでトークンを生成します:

必要な資格情報:

  • クライアント ID
  • クライアントの秘密鍵
  • スコープ (通常:openid, AdobeID, read_organizations, additional_info.projectedProductContext, read_pc.dma_aem_cloud, aem.document

トークンエンドポイント:

code language-none
https://ims-na1.adobelogin.com/ims/token/v3

サンプルリクエスト (curl):

code language-bash
curl -X POST 'https://ims-na1.adobelogin.com/ims/token/v3' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=client_credentials' \
-d 'client_id=<YOUR_CLIENT_ID>' \
-d 'client_secret=<YOUR_CLIENT_SECRET>' \
-d 'scope=AdobeID,openid,read_organizations'

応答:

code language-json
    {
    "access_token": "eyJhbGciOiJSUz...",
    "token_type": "bearer",
    "expires_in": 86399
    }

生成されたアクセストークンを使用して、開発環境、ステージ環境または実稼動環境のAPI呼び出しを行えるようになりました。

ベストプラクティス:開発、ステージング、実稼動用の資格情報の管理

  • 開発、ステージング、実稼動では、常に別々の資格情報を使用します。

  • 各資格情報を正しいAEM環境URLにマッピングします。

  • 秘密鍵を安全に保管し、それらをソース管理に委ねないでください。

  • トークンは24時間のみ有効なので、アクセストークンの有効性を追跡します。

次の手順

同期Forms Communication APIの環境を設定する方法については、AEM Forms as a Cloud Service Communications同期処理を参照してください。

関連記事

同期(オンデマンド)および非同期(バッチ)Forms Communications APIの環境を設定する方法について説明します。

同期API

AEM Forms Communications API – 同期

ドキュメントを即座に生成または処理する同期(オンデマンド)Forms Communications APIの環境を設定する方法について説明します。

詳細情報

非同期API

AEM Forms Communications API – 非同期(バッチ)

複数のドキュメントをスケジュールされた方法で生成または処理する非同期(バッチ)Forms Communications APIの環境を設定する方法について説明します。

詳細情報

recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab