Im trying to create a resource using the keycloak protection API but when i try to create a resource with a POST to http://{{host}}:{{port}}/realms/{{realm}}/authz/protection/resource_set
body:
{
"name":"Test Resource",
"owner": "resource_ceo",
"ownerManagedAccess": true
}
I get the return: Resource not found.
I'm making sure i get a PAT token beforehand with a POST to
http://{{host}}:{{port}}/auth/realms/{{realm}}/protocol/openid-connect/token
grant_type: client_credentials.
Why is it telling me the resource wasnt found, if im trying to create one?
CodePudding user response:
I had to add /auth/ in the POST endpoint so it needed to be:
http://{{host}}:{{port}}/auth/realms/{{realm}}/authz/protection/resource_set
Legacy version of the URL