services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java
/**
     * Revoke consent for particular client
     *
     * @param id
     * @param clientId
     */
Revoke consent for particular client

@param id
@param clientId
Revoke consent for particular client @param id @param clientId
@Path("{id}/consents/{client}")
    @DELETE
    @NoCache
    public void revokeConsent(final @PathParam("id") String id, final @PathParam("client") String clientId) {
        auth.requireManage();
        UserModel user = session.users().getUserById(id, realm);
        if (user == null) {
            throw new NotFoundException("User not found");
        }
        ClientModel client = realm.getClientByClientId(clientId);
        boolean revoked = user.revokeConsentForClient(client.getId());
        if (revoked) {
            AuthenticationManager.backchannelUserFromClient(session, realm, user, client, uriInfo, headers);
        } else {
            throw new NotFoundException("Consent not found for user " + id + " and client " + clientId);
        }
        adminEvent.operation(OperationType.ACTION).resourcePath(uriInfo).success();
    }
@ Path ( "{id}/consents/{client}" ) @ DELETE @ NoCache public void revokeConsent ( final @ PathParam ( "id" ) String id , final @ PathParam ( "client" ) String clientId ) { auth . requireManage ( ) ; UserModel user = session . users ( ) . getUserById ( id , realm ) ; if ( user == null ) { throw new NotFoundException ( "User not found" ) ; } ClientModel client = realm . getClientByClientId ( clientId ) ; boolean revoked = user . revokeConsentForClient ( client . getId ( ) ) ; if ( revoked ) { AuthenticationManager . backchannelUserFromClient ( session , realm , user , client , uriInfo , headers ) ; } else { throw new NotFoundException ( "Consent not found for user " + id + " and client " + clientId ) ; } adminEvent . operation ( OperationType . ACTION ) . resourcePath ( uriInfo ) . success ( ) ; }
Revoke consent for particular client
Revoke consent for particular client
// Logout clientSessions for this user and client
