You can view and manage the virtual users for a token attribute rule
using the Token Attribute Rule REST API.
The cURL command examples use the URL
structure:
http(s)://host:port/wsm-pmrest/v2/trust/{trustname}/attributerule/virtualuser
The following use case shows you how to:
-
Create a virtual User
-
View a virtual User
-
Modify a virtual User
-
Delete a virtual User
To manage virtual users using the Token Attribute Rules REST API:
- Specify the headers on the cURL command line:
-H Accept:application/json
- Add the virtual user for the token attribute rule (issuer name
www.abccompany.com
and identifier myidentifier1
) with
the default roles and enable it by running the following command:
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
Example
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
See Create VirtualUser.
The following shows an example of the request
body:
{
"enabled": "true",
"defaultRoles": [
"defaultRole1",
"defaultRole2"
]
}
The following shows an example of the response indicating the request
succeeded.
{
"STATUSCODE": "20121",
"MESSAGE": "VirtualUser of TokenAttributeRule identified by identifier \"mydentifier1\" and issuer \"www.abccompany.com\" is successfully created."
}
- Disable the
virtualuser
by running the following command:
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
Example
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
For more information, see Update VirtualUser.
The following shows an example of the request body:
The following shows an example of the response indicating the request
succeeded.
{
"STATUSCODE": "20122",
"MESSAGE": "VirtualUser of TokenAttributeRule identified by identifier \"myidentifier1\" and issuer \"www.abccompany.com\" is successfully updated."
}
- View the
virtualuser
by running the following command: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
Example
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
See Get VirtualUser.
The following shows an example of the response indicating the request succeeded.
{
"enabled": "false",
"defaultRoles": [
"defaultRole1",
"defaultRole2"
]
}
- Optionally, delete the virtual user by running the following command:
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
Example
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
See Delete VirtualUser.
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20124",
"MESSAGE": "VirtualUser of TokenAttributeRule identified by identifier \"mydentifier1\" and issuer \"www.abccompany.com\" is successfully deleted"
}