8000 It should be possible to list client permissions · Issue #119 · keycloak/keycloak-client · GitHub
[go: up one dir, main page]

Skip to content

It should be possible to list client permissions #119

Open

Description

@elliott-miller

Description

The REST API has endpoints for listing client permissions

Discussion

No response

Motivation

No response

Details

For example:

import java.util.List;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.resource.ClientResource;
import org.keycloak.admin.client.resource.ResourcePermissionsResource;
import org.keycloak.representations.idm.authorization.ScopePermissionRepresentation;

public class Example {
  public static void main(String[] args) {
    try (Keycloak kc = Keycloak.getInstance(
        "http://example",
        "master",
        "admin",
        "admin",
        "admin-cli")) {
      ClientResource clientResource = kc.realm("my-realm").clients().get("my-client");

      List<ResourcePermissionsResource> resourced = clientResource.authorization().permissions().resource().list();
      List<ScopePermissionRepresentation> scoped = clientResource.authorization().permissions().scope().list();
    }
  }
}

The REST endpoints already exist:

GET /admin/realms/{realm}/clients/{client-uuid}/authz/resource-server/permissions/scope
GET /admin/realms/{realm}/clients/{client-uuid}/authz/resource-server/permissions/resource

Activity

  1. mposolda commented on Jan 16, 2025

    @mposolda
    Contributor

    @elliott-miller Thanks! Keycloak team probably won't have time to look into this. PR may be good. Note that you will need to contribute to main repository https://github.com/keycloak/keycloak , which would then be later synced here (See CONTRIBUTING.md for the details).

  2. added
    status/fix-in-keycloak-requiredRefers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later
    on Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0