How to find the authorization subject IDs that I can use in policies?

I know there is a documentation on the subject ID pattern (Basic concepts > Authentication and authorization > Policy), but how can I find out, what exact subject IDs are usable with my current authentication?

Answer

There is a REST resource (apidocs: Policies > /whoami), which will return the authorization subject IDs, that you can use with your current authentication.

It will return JSON with the following example payload:

{
  "defaultSubject": "iot-suite:S-1-2-3/service-instance.4-5-6.iot-things@7-8-9",
  "subjects": [
    "iot-suite:S-1-2-3/service-instance.4-5-6.iot-things@7-8-9",
    "iot-suite:/service-instance.4-5-6.iot-things@7-8-9",
    "iot-suite:S-1-2-3/service-instance.4-5-6.iot-things",
    "iot-suite:/service-instance.4-5-6.iot-things"
  ] 
}

The defaultSubject will be used as default subject ID when creating a new thing or policy, but you will also have access to any resource that allows access for one of the subject IDs in the subjects list.

The Bosch IoT Things dashboard also shows all subject IDs for the authenticated user in the personal area pop-up.

Imprint Legal info Privacy statement