You can view and manage the discovery information for a token issuer using the Token Issuer REST API.
The cURL command examples use the URL structure:
http(s)://host:port/wsm-pmrest/v2/trust/issuer/{issuername}/{tokentype}/discoveryinfo
The following use case shows you how to:
-
Add the discovery information
-
Modify the discovery information
-
View the discovery information
-
Delete the discovery information
To manage the trusted key using the Token Issuer Trust REST API:
- Specify the headers on the cURL command line:
-H Accept:application/json
- Add the discovery information for the issuer
www.example.com
with base URL 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}/issuer/{issuername}/{tokentype}/discoveryinfo
Example
curl -i -X POST -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer/www.example.com/jwt/discoveryinfo
See Create the DiscoveryInfo.
The following shows an example of the request body.
{
"baseUrl": "http://abccompany.com"
}
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20161",
"MESSAGE": "DiscoveryInfo for Issuer name \"www.example.com\" and tokenType \"jwt\" is successfully created."
}
- Modify the discovery information by adding the discovery URL to the issuer
www.example.com
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}/issuer/{issuername}/{tokentype}/discoveryinfo
Example
curl -i -X PATCH -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer/www.example.com/jwt/discoveryinfo
See Update the DiscoveryInfo.
The following shows an example of the request body.
{
"discoveryUrl": "http://www.examplecompany.com"
}
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20162",
"MESSAGE": "DiscoveryInfo for Issuer name \"www.example.com\" and tokenType \"jwt\" is successfully updated."
}
- View the discovery information details for
www.example.com
issuer in the repository 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}/issuer/{issuername}/{tokentype}/discoveryinfo
Example
curl -i -X GET -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer/www.example.com/jwt/discoveryinfo
See Get the DiscoveryInfo.
The following shows an example of the response body:
{
"baseUrl": "http://abccompany.com",
"discoveryUrl": "http://www.examplecompany.com"
}
- Optionally, delete the discovery information for the
www.example.com
issuer from the repository by running the following command:
curl -i -X DELETE -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/issuer/{issuername}/{tokentype}/discoveryinfo
Example
curl -i -X DELETE -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/trust/myTrustDocument/issuer/www.example.com/jwt/discoveryinfo
Delete the DiscoveryInfo.
The following shows an example of the response indicating the request succeeded.
{
"STATUSCODE": "20164",
"MESSAGE": "DiscoveryInfo for Issuer name \"www.example.com\" and tokenType \"jwt\" is successfully deleted."
}