Skip to content

Setting authorization resource owner does not work or fails #589

@HendrikJanssen

Description

@HendrikJanssen

Current Behavior

When I want to set the owner of a resource, keycloak-config-cli either fails to create the resource (400 Bad request) is returned, or the owner is not set when updating the resource.

"resources": [
  {
    "name": "testresource",
    "type": "urn:testrealm:resources:test",
    "ownerManagedAccess": false,
    "owner": {
      "name": "testuser"
     },
     "uri": "/*",
     "scopes": [
       {
         "name":  "testscope"
       }
     ]
   }
]

Expected Behavior

The resource owner should be set accordingly.

Steps To Reproduce

1. Create a minimal realm with a user and a confidential client
2. Enable authorization on client
3. Try to create or update a resource with an owner (either via id or username) as shown above.

Either - when creating a 400 Bad request is returned from the cli
Or - when updating a resource nothing happens and keycloak-config-cli reports a successful update

Environment

Im using the docker hub image version of keycloak-config-cli

  • Keycloak Version: 15.0.2
  • keycloak-config-cli Version: adorsys/keycloak-config-cli:v4.4.0-15.0.2
  • Java Version: seems to be 17 in the image

Anything else?

I am not sure what happens here since the request body is not printed out sadly. I do know that setting a resource owner is pretty finicky via the admin CLI. If this is a missing feature and not a bug I would gladly support with an PR, but maybe this is supposed to work, so Im opening an Issue first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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