- Oracle Web Services Manager REST APIOracle Web Services Manager REST API
- ユース・ケース
- トークン属性ルールの管理
- 仮想ユーザーの構成
仮想ユーザーの構成
トークン属性ルールREST APIを使用して、トークン属性ルールの仮想ユーザーを表示および管理できます。
cURLコマンドの例では、URL構造を使用しています:
http(s)://host:port/wsm-pmrest/v2/trust/{trustname}/attributerule/virtualuser
次の方法を使用事例で示します。
-
仮想ユーザーの作成
-
仮想ユーザーの表示
-
仮想ユーザーの変更
-
仮想ユーザーの削除
トークン属性ルールREST APIを使用して仮想ユーザーを管理するには:
- cURLコマンド・ラインでヘッダーを指定します。
-H Accept:application/json
- 次のコマンドを実行して、デフォルト・ロールを指定して、トークン属性ルール(発行者名
www.abccompany.com
および識別子myidentifier1
)の仮想ユーザーを追加して、有効にします:注意:
仮想ユーザーのロール・マッピングおよびロール属性を設定するには、「ロール・マッピングの管理」を参照してください。curl -i -X POST -u username:password -H Content-type:application/json http(s)://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/virtualuser
例
curl -i -X POST -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/attributerule/www.abccompany.com/myidentifier1/virtualuser
「VirtualUserの作成」を参照してください。
次に、リクエスト本文の例を示します:{ "enabled": "true", "defaultRoles": [ "defaultRole1", "defaultRole2" ] }
次にリクエストの成功を示すレスポンスの例を示します。
{ "STATUSCODE": "20121", "MESSAGE": "VirtualUser of TokenAttributeRule identified by identifier \"mydentifier1\" and issuer \"www.abccompany.com\" is successfully created." }
- 次のコマンドを実行して、
virtualuser
を無効にします:curl -i -X PATCH -u username:password -H Content-type:application/json http(s)://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/virtualuser
例
curl -i -X PATCH -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/attributerule/www.abccompany.com/myidentifier1/virtualuser
詳細は、「VirtualUserの更新」を参照してください。
次に、リクエスト本文の例を示します:
{"enabled": "false"}
次にリクエストの成功を示すレスポンスの例を示します。
{ "STATUSCODE": "20122", "MESSAGE": "VirtualUser of TokenAttributeRule identified by identifier \"myidentifier1\" and issuer \"www.abccompany.com\" is successfully updated." }
- 次のコマンドを実行して、
virtualuser
を表示します:curl -i -X GET -u username:password -H Content-type:application/json http(s)://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/virtualuser
例
curl -i -X GET -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/attributerule/www.abccompany.com/myidentifier1/virtualuser
「VirtualUserの取得」を参照してください。
次にリクエストの成功を示すレスポンスの例を示します。
{ "enabled": "false", "defaultRoles": [ "defaultRole1", "defaultRole2" ] }
- オプションで、次のコマンドを実行して、仮想ユーザーを削除します:
curl -i -X DELETE -u username:password -H Content-type:application/json http(s)://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/virtualuser
例
curl -i -X DELETE -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/attributerule/www.abccompany.com/myidentifier1/virtualuser
「VirtualUserの削除」を参照してください。
次にリクエストの成功を示すレスポンスの例を示します。
{ "STATUSCODE": "20124", "MESSAGE": "VirtualUser of TokenAttributeRule identified by identifier \"mydentifier1\" and issuer \"www.abccompany.com\" is successfully deleted" }