信頼できるトークン発行者の管理

トークン発行者REST APIを使用して、トークン発行者の信頼ドキュメントの信頼できるトークン発行者を表示および管理できます。

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

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

  • 信頼できる発行者の作成

  • 信頼できる発行者の変更

  • 信頼できる発行者の表示

  • 信頼できる発行者の削除

トークン発行者信頼REST APIを使用して、トークン発行者の信頼を管理するには:

  1. cURLコマンド・ラインでヘッダーを指定します。
    -H Accept:application/json
  2. 次のコマンドを実行して、信頼できる発行者ドキュメントmyTrustDocumentに、トークン・タイプがjwtwww.example.comとトークン・タイプがsaml.hokwww.oracle.comの2つの発行者を作成します:
    curl -i -X POST -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/issuer

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

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

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

    [
      {
        "issuername": "www.example.com",
        "tokentype": "jwt"
      },
      {
        "issuername": "www.oracle.com",
        "tokentype": "saml.hok"
      }
    ]

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

    {
      "STATUSCODE": "20061",
      "MESSAGE": "Issuer \"[issuername:www.example.com, tokentype:jwt, issuername:www.oracle.com, tokentype:saml.hok]\" are successfully created."
    }

    ノート:

    信頼できるキーを定義し、検出情報とリライイング・パーティ・リストをトークン発行者の信頼に追加するには、次を参照してください:

  3. 次のコマンドを実行して、発行者www.example.comを無効にします:
    curl -i -X PATCH -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/issuer

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

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

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

    [
      {
        "issuername": "www.example.com",
        "tokentype": "jwt",
        "enabled": "false"
      }
    ]

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

    {
      "STATUSCODE": "20062",
      "MESSAGE": "Issuer \"[issuername:www.example.com, tokentype:jwt]\" are successfully updated."
    }

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

  4. issuernameおよびtokentypeの問合せパラメータを指定して、リポジトリ内の発行者www.oracle.comの詳細を表示します:
    curl -i -X GET -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{aTrustDocName}/issuer?issuername={IssuerName}&tokentype={TokenTypeValue}

    curl -i -X GET -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer/?issuername=www.oracle.com
    

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

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

    [
      {
        "issuername": "www.oracle.com",
        "tokentype": "saml.hok",
        "enabled": "true",
        "trustedkey": {
          "keyidentifiers": [
            {
              "keytype": "x509certificate",
              "valuetype": "dn",
              "value": "CN=Bob,OU=OASIS Interop Test Cert,O=OASIS",
              "enabled": "true"
            }
          ]
        }
      }
    ]
  5. オプションで、次のコマンドを実行して、発行者www.example.comをリポジトリから削除します:
    curl -i -X DELETE -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/issuer?issuername={IssuerName}&tokentype={TokenType}

    curl -i -X DELETE -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer/?issuername=www.example.com
    

    「TokenIssuerの削除」を参照してください。

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

    {
      "STATUSCODE": "20064",
      "MESSAGE": "Following Issuer(s) are successfully deleted: [issuername:www.example.com, tokentype:jwt]"
    }
  6. オプションで、次のコマンドを実行して、トークン・タイプsaml.hokに基づく発行者をリポジトリから削除します:
    curl -i -X DELETE -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/issuer?issuername={IssuerName}&tokentype={TokenType}

    curl -i -X DELETE -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer?tokentype=saml.hok
    

    「TokenIssuerの削除」を参照してください。

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

    {
      "STATUSCODE": "20064",
      "MESSAGE": "Following Issuer(s) are successfully deleted: [issuername:www.oracle.com, tokentype:saml.hok]"
    }