JavaScript Adapter and resources

Hello

I have a single page application in JavaScript. I’m using keycloak with keycloak-js to manage access.

I would like to assigne role at resource level. I think the method hasResourceRole(role, resourse) on the js adapter will fit perfectly my need.

But I don’t understand how I could create resource with a public client.
From my understanding :

  • The js adapter requiere public client.
  • Resources can be created only with “Authorization Enabled”, that require a confidential client.

What do I miss ? How can I set up resource role and use the hasResourceRole method ?

Thank you