Getting error when adding @MicroserviceApplication in Spring Boot Project

Sure, two steps:

  1. Add the Role name in the manifest: General aspects - Cumulocity IoT Guides
  2. Annotate your endpoint with that role
@PreAuthorize("hasRole('ROLE_A')")

https://cumulocity.com/guides/microservice-sdk/java/#microservice-security

Please note that the new role will be created when the microservice is deployed in the tenant. From Administration → Roles or users you can then find this new defined role and assign it to specific users only.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.