[AEM Forms]{class="badge positive" title="AEM Formsに適用)。"}
OAuth サーバー間認証
OAuth Server-to-Server Authenticationにより、ユーザーの操作を必要とせずに、AEM Forms Communications APIへのトークンベースの安全なアクセスが可能になります。 OAuth サーバー間認証は、Adobe Developer Consoleでサポートされています。
前提条件
開始する前に、次の前提条件が満たされていることを確認してください。
- 使用している環境に固有のAdobe Developer Consoleへのアクセス権があることを確認してください。
- Adobe Developer Consoleへのアクセスを有効にするには、Adobe Admin Consoleでシステム管理者または開発者の役割を割り当てます。
OAuth サーバー間認証を使用してアクセストークンを生成する方法を教えてください。
次の手順に従って、Adobe Developer コンソールからアクセストークンを生成し、OAuth Server-to-Server Authenticationを介して最初のAPI呼び出しを行います。
1. Adobe Developer Console プロジェクト設定
-
Adobe Developer Consoleに移動します
-
Adobe IDでログイン
-
新規プロジェクトを作成するか、既存のプロジェクトに移動します
-
クイックスタート セクションで、新規プロジェクトの作成をクリックします
-
新しいプロジェクトがデフォルト名で作成されます
-
右上隅の「プロジェクトを編集」をクリックします
-
意味のある名前を指定します(例:「formsproject」)。
-
「保存」をクリックします。
-
Adobe Developer Consoleから すべてのプロジェクト をクリックします
-
プロジェクトを見つけて、クリックして開きます。
2. Forms APIの追加
次の操作に基づいてForms APIを追加します。
- AEM Forms Communications API:ドキュメント(PDFおよび関連する形式)の生成、変換、組み立て、またはセキュリティ保護が必要な場合に使用します。
- アダプティブ Forms ランタイム API – 実行時にアダプティブ Formsをレンダリング、送信、処理する必要がある場合に使用します。
-
「APIを追加」をクリックします
-
Forms Communication APIを選択
-
Add API ダイアログで、Experience Cloudでフィルタリングします
-
「Forms Communication API」を選択
-
「次へ」をクリックします。
-
OAuth サーバー間認証方法を選択
-
-
「APIを追加」をクリック
-
AEM Forms Delivery and Runtime APIを選択
-
Add API ダイアログで、Experience Cloudでフィルタリングします
-
「AEM Forms Delivery and Runtime API」を選択
-
「次へ」をクリックします。
-
OAuth サーバー間認証方式を選択します。
-
You can also add the API and authentication method to your existing project by clicking Add to Project > API
3. Add Product Profile
Product profile provides permissions (or authorization) for credentials to access the AEM resources.
-
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. -
-
「設定済み API を保存」をクリックします。 The API and Product Profile are added to your project
4. Generate and Save Credentials
-
Navigate to your project in Adobe Developer Console
-
Click OAuth Server-to-Server credential
-
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:
Generate access tokens manually in Adobe Developer Console:
-
Navigate to your Project
- In Adobe Developer Console, open your project
- Click OAuth Server-to-Server
-
アクセストークンを生成
- プロジェクトのAPI セクションで「"アクセストークンを生成"」ボタンをクリックします
- 生成されたアクセストークンをコピー
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 |
|---|
|
サンプルリクエスト (curl):
| code language-bash |
|---|
|
応答:
| code language-json |
|---|
|
生成されたアクセストークンを使用して、開発環境、ステージ環境または実稼動環境のAPI呼び出しを行えるようになりました。
ベストプラクティス:開発、ステージング、実稼動用の資格情報の管理
-
開発、ステージング、実稼動では、常に別々の資格情報を使用します。
-
各資格情報を正しいAEM環境URLにマッピングします。
-
秘密鍵を安全に保管し、それらをソース管理に委ねないでください。
-
トークンは24時間のみ有効なので、アクセストークンの有効性を追跡します。
次の手順
同期Forms Communication APIの環境を設定する方法については、AEM Forms as a Cloud Service Communications同期処理を参照してください。
関連記事
同期(オンデマンド)および非同期(バッチ)Forms Communications APIの環境を設定する方法について説明します。
AEM Forms Communications API – 同期
ドキュメントを即座に生成または処理する同期(オンデマンド)Forms Communications APIの環境を設定する方法について説明します。
AEM Forms Communications API – 非同期(バッチ)
複数のドキュメントをスケジュールされた方法で生成または処理する非同期(バッチ)Forms Communications APIの環境を設定する方法について説明します。