Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It should be possible to list client permissions #119

Open
elliott-miller opened this issue Jan 6, 2025 · 1 comment
Open

It should be possible to list client permissions #119

elliott-miller opened this issue Jan 6, 2025 · 1 comment
Labels
area/admin-client help wanted Extra attention is needed priority/low status/fix-in-keycloak-required Refers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later

Comments

@elliott-miller
Copy link

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

@mposolda
Copy link
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).

@mposolda mposolda added the status/fix-in-keycloak-required Refers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin-client help wanted Extra attention is needed priority/low status/fix-in-keycloak-required Refers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later
Projects
None yet
Development

No branches or pull requests

2 participants