トークン発行者の信頼ドキュメントの管理

REST APIを使用して、トークン発行者の信頼を参照および管理できます。

cURLコマンドの例では、URL構造を使用しています:
http(s)://host:port/wsm-pmrest/v2/trust

次の方法を使用事例で示します。

  • 新しいトークン発行者の信頼ドキュメントの作成

  • トークン発行者の信頼ドキュメントの変更

  • トークン発行者の信頼ドキュメントの表示

  • トークン発行者の信頼ドキュメントの削除

トークン発行者の信頼ドキュメントを管理するには:

  1. cURLコマンド・ラインでヘッダーを指定します。
    -H Accept:application/json
  2. 次のコマンドを実行して、信頼ドキュメントmyTrustDocumentを作成します:

    注意:

    トークン属性ルールを定義し、信頼できるトークン発行者を追加するには、「トークン属性ルールの管理」および「信頼できるトークン発行者の管理」を参照してください。
    curl -i -X POST -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust

    curl -i -X POST -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust
    

    「Trustの作成」を参照してください。

    次に、リクエスト本文の例を示します。

    [
      {
        "trustname": "myTrustDocument"
      }
    ]

    次にリクエストの成功を示すレスポンスの例を示します。

    {
      "STATUSCODE": "20051",
      "MESSAGE": "Trusts \"[myTrustDocument]\" are successfully created."
    }
  3. 次のコマンドを実行して、信頼できる発行者ドキュメントmyTrustDocumentを変更して、表示名TrustDocumentを追加します:
    curl -i -X PATCH -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust

    curl -i -X PATCH -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust
    

    「Trustの更新」を参照してください。

    次に、リクエスト本文の例を示します。

    [
      {
        "trustname": "myTrustDocument",
        "displayname": "TrustDocument"
      }
    ]

    次にリクエストの成功を示すレスポンスの例を示します。

    {
      "STATUSCODE": "20052",
      "MESSAGE": "Trusts \"[myTrustDocument]\" are successfully updated."
    }
  4. リポジトリ内のすべての信頼できる発行者ドキュメントの信頼名および表示名を表示します。
    curl -i -X GET -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/?detail={true/false}

    curl -i -X GET -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/?detail=true
    

    「すべてのTrustの取得」を参照してください。

    次に、問合せパラメータ?detail=trueを指定した後のレスポンス本文の例を示します:

    [
      {
        "trustname": "myTrustDocument",
        "displayname": "TrustDocument"
      },
      {
        "trustname": "owsm-trust-doc",
        "displayname": "owsm-trust-doc"
      },
      {
        "trustname": "tokenIssuertrustWLS_server_domain",
        "displayname": "wls_owsm_server_domain_trust_document"
      },
      {
        "trustname": "tokenIssuertrust_test",
        "displayname": "tokenIssuertrust_test"
      },
      {
        "trustname": "oracle-default",
        "displayname": "i18n:oracle.wsm.resources.resdesc.ResourceDescriptionBundle_property-TokenIssuerTrust_displayName"
      }
    ]
  5. 次のコマンドを実行して、リポジトリの信頼できる発行者ドキュメントmyTrustDocumentの構成詳細を表示します:
    curl -i -X GET -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{TrustDocName}

    curl -i -X GET -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument

    「Trustの取得」を参照してください。

    次に、レスポンス本文の例を示します:

    {
      "trustname": "myTrustDocument",
      "displayname": "TrustDocument"
    }
  6. 次のコマンドを実行すると、信頼できる発行者ドキュメントmyTrustDocumentをリポジトリから削除できます:
    curl -i -X DELETE -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}

    curl -i -X DELETE -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument

    「Trustの削除」および「すべてのTrustの削除」を参照してください。

    次にリクエストの成功を示すレスポンスの例を示します。

    {
      "STATUSCODE": "20054",
      "MESSAGE": "Following Trust(s) are successfully deleted: [myTrustDocument]"
    }