Delete User Consent's

delete

/oauth2/rest/consent

The REST API enables End User to delete consents related to a User. Multiple consents can be deleted simultaneously by specifing multiple consent identifier.

Request

Supported Media Types
Query Parameters
  • Unique Consent Identifier that needs to be revoked. The value of this parameter can be fetched from GET Consent response.
  • Identity Domain under which the token is being requested. This is an optional parameter if 'x-oauth-identity-domain-name' header parameter is provided.
Header Parameters
Back to Top

Response

Supported Media Types

200 Response

Sucessfully deleted user consents - detail
Body ()
Root Schema : consent
Type: array
Array of user consent
Show Source

400 Response

Failed to delete user consent - detail
Body ()
Back to Top

Examples

The following example shows a sample request and response for deleting the consents.

cURL Command to Delete Consents

curl --location --request DELETE 'http://<lbr-host>:<lbr-port>/oauth2/rest/consent?cid=ebe683b9-0345-3c35-a21d-35e57958ed21&cid=8c1d5d3a-dc74-3939-aa72-03c12fcff3b3' \
--header 'X-OAUTH-IDENTITY-DOMAIN-NAME: DemoDomain' \
--header 'OAM_REMOTE_USER: DemoUser'

Sample Response

{
    "consents": [
        {
            "consentId": "ebe683b9-0345-3c35-a21d-35e57958ed21",
            "clientId": "DemoClient",
            "resourceId": "506a50c2-a892-49ee-85ad-9993169a18bf",
            "scopes": [
                "DemoResource.editDemoRes",
                "DemoResource.delDemoRes",
                "DemoResource.viewDemoRes"
            ],
            "additionalScopes": null,
            "createTimeStamp": "Wed Apr 08 23:06:54 PDT 2020",
            "valid": false
        },
        {
            "consentId": "8c1d5d3a-dc74-3939-aa72-03c12fcff3b3",
            "clientId": "DemoClient",
            "resourceId": "OPENID_MGMT_RESOURCE",
            "scopes": [
                "openid",
                "profile",
                "email"
            ],
            "additionalScopes": null,
            "createTimeStamp": "Wed Apr 08 23:06:54 PDT 2020",
            "valid": false
        }
    ]
}
Back to Top