- Print
- DarkLight
- PDF
Access Roles
With the introduction of “Open Authentication” the API is taking advantage of the concept of “Roles”. Within the “JSON Web Token” the token issuer can define which endpoints the application can use of the API. The issuer can also determine which database connection strings the application is permitted to use, among “Multiple database connection strings”.
It is the “Payload” part of the “JSON Web Token” which contains the “Roles” element. This is an array of values with one or more items.
The syntax of one item:
<database connection string key> + "." + <endpoint> + "." + <action>
Each item specify which part of the API is permitted to access:
- The database connection string key.
- This is per your configuration in the “application.json” file, “Connections Strings”
- This is per your configuration in the “application.json” file, “Connections Strings”
- The API endpoint.
- The value is any of the supported endpoints of the API. Such as “resources”, “activities”, etc.
- This also supports the value “all”, meaning all endpoints is accessible.
- The API endpoint action.
- This value determine which action is permitted on the endpoint. Values could be:
- "read" - the application can call GET endpoint.
- "edit" - the application can call PATCH endpoint.
- "create" - the application can call POST endpoint with action Create.
- "delete" - the application can call POST endpoint with action Delete.
- "update" - the application can call POST endpoint with action Update.
- This also supports the value "all", meaning all actions listed above.
- This value determine which action is permitted on the endpoint. Values could be:
Example:
"roles": [
"integrationapi.all.read",
"integrationapi.all.edit",
"integrationapi.all.create",
"integrationapi.all.update",
"default.all.edit",
"default.all.read",
"default.all.update",
"default.resources.create"
],