You can view and manage the name ID for a token attribute rule using the Token Attribute Rule REST API.
The cURL command examples use the URL structure:
http://host:port/wsm-pmrest/v2/trust/{aTrustDocName}/attributerule/{anIssuerName}/{anIdentifier}/nameid
The following use case shows you how to:
-
Create name ID
-
View name ID
-
Modify name ID
-
Delete name ID
To manage name ID of a sepcific TokenAttributeRule:
- Specify the headers on the cURL command line:
-H Accept:application/json
- Set the the name ID
myTrustedUser
with the user mapping attributes and the user mapping attribute for the token attribute rule (issuer name www.abccompany.com
and identifier myidentifier1
) by running the following command:
curl -i -X POST -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/nameid
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/nameid
See Create NameId.
The following shows an examples of the request body:
{
"nameidAttribute": "myTrustedUser",
"filter": [
"filter1",
"filter2"
]
}
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20151",
"MESSAGE": "NameId \"myTrustedUser\" is successfully created."
}
- Modify the name ID
yourTrustedUser
to OrgTrustedUser
and filters by running the following command:
curl -i -X PATCH -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/nameid
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/nameid
See Update NameId.
The following shows an examples of the request body:
{
"nameidAttribute": "OrgTrustedUser",
"filter": [
"Orgfilter1",
"Orgfilter2"
]
}
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20152",
"MESSAGE": "NameId \"orgTrustedUser\" is successfully updated."
}
- View the name ID for the token attribute rule (issuer name
www.abccompany.com
and identifier myidentifier1
) by running the following command:
curl -i -X GET -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/nameid
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/nameid
See Get NameId.
The following shows an example of the response indicating the request succeeded.
{
"filter": [
"Orgfilter1",
"Orgfilter2"
],
"nameidAttribute": "OrgTrustedUser"
}
- Optionally, delete the name ID
orgTrustedUser
by running the following command:
curl -i -X DELETE -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustdocumentName}/attributerule/{issuername}/{identifier}/nameid
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/nameid
For more information, see Delete NameId.
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20154",
"MESSAGE": "NameId \"OrgTrustedUser\" is successfully deleted."
}