Delete User Consent's
delete
/oam/services/rest/consent
The REST API enables Administrator to delete consents related to a User. Multiple consents can be deleted simultaneously by specifing multiple consent identifier.
Request
Supported Media Types
- application/x-www-form-urlencoded
Query Parameters
-
cid: string
Unique Consent Identifier that needs to be revoked. The value of this parameter can be fetched from GET Consent response.
-
userId(required): string
User name/identifier who's consents needs to be retrieved.
Header Parameters
-
authorization(required): string
Base64 encoded header of Administrator:Secret. This is an authentication mechanism for weblogic Administrator to access resource.
-
x-oauth-identity-domain-name(required): string
OAuth Identity Domain name under which user consents are expected.
Response
Supported Media Types
- application/json
200 Response
Sucessfully deleted user consents - detail
Nested Schema : consent
Type:
Show Source
object
-
clientId(required):
string
OAuth Client Identifier
-
consentId(required):
string
OAuth Consent Unique Identifier
-
createTimeStamp(required):
string
Creation timestamp for OAuth Consent
-
resourceId(required):
string
OAuth Application Identifier
-
scopes(required):
array scope
-
valid(required):
boolean
Flag to identify OAuth Consent validity. True - Consent is valid, False - Consent is In-valid
400 Response
Failed to delete user consent - detail
Root Schema : schema
Type:
Show Source
object
-
error:
string
Error code
-
error_description:
string
Error description
Example:
{
"error":"400",
"error_description":"Required parameter 'userId' is not present."
}
Examples
The following example shows a sample request and response against the Admin Server for deleting the consents.
cURL Command to Delete Consents
curl --location --request DELETE 'https://<AdminServerHost:AdminServerPort>/oam/services/rest/consent?cid=ebe683b9-0345-3c35-a21d-35e57958ed21&userId=DemoUser&cid=8c1d5d3a-dc74-3939-aa72-03c12fcff3b3' \ --header 'X-OAUTH-IDENTITY-DOMAIN-NAME: DemoDomain' \ --header 'Authorization: Basic d2VibG9naWM6d2VsY29tZTE='
Sample Response
{ "consents": [ { "clientId": "DemoClient", "consentId": "ebe683b9-0345-3c35-a21d-35e57958ed21", "createTimeStamp": "Wed Apr 08 22:12:15 PDT 2020", "resourceId": "506a50c2-a892-49ee-85ad-9993169a18bf", "scopes": [ "DemoResource.editDemoRes", "DemoResource.delDemoRes", "DemoResource.viewDemoRes" ], "valid": false }, { "clientId": "DemoClient", "consentId": "8c1d5d3a-dc74-3939-aa72-03c12fcff3b3", "createTimeStamp": "Wed Apr 08 22:12:15 PDT 2020", "resourceId": "OPENID_MGMT_RESOURCE", "scopes": [ "openid", "profile", "email" ], "valid": false } ] }