- REST API for Oracle Web Services ManagerREST API for Oracle Web Services Manager
- Use Cases
- Manage the Trusted Token Issuer
- Configure the Trusted Keys
- Configure the Trusted key Identifiers
Configure the Trusted key Identifiers
You can view and manage the trusted key identifiers for the trusted keys using the Token Issuer REST API.
http(s)://host:port/wsm-pmrest/v2/trust/issuer/{issuername}/{tokentype}/trustedkey/keyidentifier
The following use case shows you how to:
-
Add the trusted key identifiers
-
Modify the trusted key identifiers
-
View the trusted key identifiers
-
Delete the trusted key identifiers
To manage the trusted key identifiers for trusted key:
- Specify the headers on the cURL command line:
-H Accept:application/json
- Add the trusted key identifiers to the trusted key for the issuer
www.example.com
andjwt
as the token type and specify the metadata URL and refresh interval 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}/trustedkey/keyidentifier
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/trustedkey/keyidentifier
See Add KeyIdentifier(s).
The following shows an example of the request body with a single key identifier.
[ { "keytype": "x509certificate", "valuetype": "dn", "value": "cn=john", "enabled": "false" } ]
The following shows an example of the response indicating the request succeeded.
{ "STATUSCODE": "20081", "MESSAGE": "KeyIdentifier \"[keytype:x509certificate, valuetype:x509certificate, value:cn=john]\" is successfully created." }
- Enable the trusted key identifiers for 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}/trustedkey/keyidentifier
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/trustedkey/keyidentifier
The following shows an example of the request body with a single key identifier.
[ { "keytype": "x509certificate", "valuetype": "dn", "value": "cn=john", "enabled": "true" } ]
The following shows an example of the response indicating the request succeeded.
{ "STATUSCODE": "20082", "MESSAGE": "KeyIdentifier \"[keytype:x509certificate, valuetype:x509certificate, value:cn=john]\" is successfully updated." }
- View the details of all the trusted key identifiers for the issuer
www.example.com
and token typejwt
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}/trustedkey/keyidentifier
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/trustedkey/keyidentifier
See Get KeyIdentifier(s).
The following shows an example of the response body:
[ { "keytype": "x509certificate", "valuetype": "dn", "value": "cn=john", "enabled": "true" } ]
- View the details of a specific trusted key identifier for the issuer
www.example.com
by specifying thekeytype
,value
, andvaluetype
query parameters:curl -i -X GET -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/trust/{trustname}/issuer/{issuername}/{tokentype}/trustedkey/keyidentifier?keytype={PredefinedKeyType}&valuetype={PredefinedValueType}&value={KeyValue}
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/trustedkey/keyidentifier?keytype=x509certificate&valuetype=dn&value=cn=john
The following shows an example of the response body:
[ { "keytype": "x509certificate", "valuetype": "dn", "value": "cn=john", "enabled": "true" } ]
- Optionally, delete all the trusted key identifiers for the issuer
www.example.com
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}/trustedkey/keyidentifier
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/trustedkey/keyidentifier
The following shows an example of the response indicating the request succeeded.
{ "STATUSCODE": "20084", "MESSAGE": "KeyIdentifier(s) are successfully deleted." }