You can view and manage the user mapping for the token attributes using the Token Attribute Rule REST API.
The cURL command examples use the URL structure:
http://host:port/wsm-pmrest/v2/trust/{aTrustDocName}/attributerule/{issuername}/{identifier}/attribute/{attributename}/mapping
The following use case shows you how to:
-
Map the user attributes
-
View the user attributes mapping
-
Modify the user attribute mapping
-
Delete the user attribute mapping
To manage the user attribute mapping using the Token Attribute Rules Rest API:
- Specify the headers on the cURL command line:
-H Accept:application/json
- Map the user attribute to the token attribute
attr1
for the token attribute rule (Identifier myidentifier1
and Issuer Name www.abccompany.com
) by running the following command:
curl -i -X POST -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/attributerule/{issuername}/{identifier}/attribute/{attributename}/mapping
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/attribute/attr1/mapping
The following shows an example of the request body:
{
"userAttribute": "val1",
"userMappingAttribute": "userMappingattr1"
}
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20141",
"MESSAGE": "Mapping for Attribute/NameId \"attr1\" is successfully created."
}
For more information, see Create the AttributeMapping.
- Change the user mapping attribute name to
uid
for the token attribute attr1
by running the following command:
curl -i -X PATCH -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/attributerule/{issuername}/{identifier}/attribute/{attributename}/mapping
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/attribute/attr1/mapping
The following shows an example of the request body.
{
"userMappingAttribute": "uid"
}
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20142",
"MESSAGE": "Mapping for Attribute/NameId \"attr1\" is successfully updated."
}
For more information, see Update the AttributeMapping.
- View the user attribute and user mapping attribute for the token attribute
attr2
by running the following command:
curl -i -X GET -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/attributerule/{issuername}/{identifier}/attribute/{attributename}/mapping
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/attribute/attr2/mapping
The following shows an example of the response indicating the request succeeded.
{
"userAttribute": "userAttr2",
"userMappingAttribute": "userMappingAttr2"
}
For more information, see Get the AttributeMapping.
- Optionally, delete the user attribute and user mapping attribute for the token attribute
attr2
by running the following command:
curl -i -X POST -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/attributerule/{issuername}/{identifier}/attribute/{attributename}/mapping
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/attribute/attr2/mapping
See Delete the AttributeMapping.
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20144",
"MESSAGE": "Mapping for Attribute/NameId \"attr2\" is successfully deleted"
}