Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown error while creating client using Keycloak REST API

I'm trying to create a new client in my Springboot realm through the keycloak REST API using postman, but I'm getting an unknown error as the response.

The URL in post method is

localhost:8180/auth/admin/realms/springboot/clients

The header includes:

content-type - application/json
authorization - bearer <access token...>

The JSON body is

{    
  "id":"1",
  "clientId":"zzzzz",
  "name":"aaaaa",
  "description":"bbbbb",
  "redirectUris":[ "\\" ],
  "enabled":"true"
}

The response I'm getting is 403 : unknown error.

like image 520
TJ32 Avatar asked Jul 18 '26 11:07

TJ32


1 Answers

I obtained the same error because the client had not the necessary role.

  • Go to Clients -> {your-client-name}
  • Select the 'Service Account Roles' tab
  • Add the necessary role. (In my case I needed the admin role)

enter image description here

like image 171
Pythtotic Avatar answered Jul 20 '26 07:07

Pythtotic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!