0

I am trying to create the users in keycloak from java application. I am able to create users and also assign roles to the newly created users in the master realm. I have created my own realm and also added some roles in the newly created realm. While adding the users and assigning roles to the newly created users I am getting the below exception
javax.ws.rs.ForbiddenException: HTTP 403 Forbidden

I am getting an exception in the below line
RoleRepresentation testerRealmRole = realmResource.roles().get("rolename}").toRepresentation();

I have created the {rolename} in the realm. I am not able to find what is missing. Please, anyone, help me. Thanks in advance

Programmer
  • 657
  • 4
  • 9
  • 21

1 Answers1

-1

Use the below line of code

 RoleRepresentation testerRealmRole =
 realmResource.roles().get("{rolename}").toRepresentation();
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Harsh Mishra
  • 1,975
  • 12
  • 15