Work groups
Introduction
The workgroup entity is employed for the purpose of consolidating users who occupy identical roles within the specified organisation.
The workgroup entity is employed for the purpose of consolidating users who occupy identical roles within the specified organisation.
The workgroup entity enables the consolidation of disparate channels, thereby conferring management permissions upon distinct user roles.
A geo-cluster is defined as a grouping of devices belonging to multiple organisations, which are related to work groups.
For further details regarding role permissions, please refer to the section on user profiles.
For further details regarding the login process in OpenGate, please refer to the user LOG-IN section.
Two-Factor Authentication (2FA) can be configured at the user level.
The only possible value is “TOTP”. (Time-Based On-Time) as defined in [RFC-6238] (https://www.rfc-editor.org/rfc/rfc6238).
By default, this field will be set to “NONE”. If you wish to deactivate the 2FA, please set the property 2FaType to NONE and perform a PUT on the user.
Please refer to the schema for each attribute used.
In the event that two-factor authentication (2FA) has been enabled for a particular user, it is necessary to incorporate the code generated by the associated application into the “2FaCode” attribute of the JSON.
Upon initial login following the configuration of two-factor authentication (2FA), the LOGIN service will respond with a URL location in the headers containing the configuration parameters. These parameters should be used to configure your application to generate the codes.
The URL will be as follows: otpauth://totp/2FA?secret=CAX3VP5O7GWZXUDWQOK4267DGXXSFIDQ&issuer=OpenGate&algorithm=SHA1&digits=6&period=30
Some applications only require the secret field, while others may need all parameters.
Please replace {id} with the email address of the user you wish to retrieve.
There are two ways to use the GET method:
An administrator is able to modify another user’s API key or password, update their own API key, or update their own password.
Any user with administration role is allowed to change the ApiKey / password of any managed user (excluding himself), the same way as any other user’s field.
In this case, the ApiKey or password will be considered as any other basic user data. In this case, it’s allowed to change the ApiKey or password with any other user’s field. If the administrator needs to change his own ApiKey/password, it must be done as explained bellow.
Any user with an administrative role is permitted to modify the ApiKey/password of any managed user (excluding themselves), in a manner consistent with the process for modifying any other user’s field.
In this instance, the ApiKey or password will be treated in the same way as any other basic user data. It is therefore permitted to change the ApiKey or password with any other user’s field. If the administrator wishes to change their own ApiKey/password, this must be done in accordance with the instructions set out below.
As with updating your own ApiKey, any user is able to change their own password. This is the only method available, regardless of whether the user has an administration profile. In this case, the current user’s password must be included in the X-ApiPass field of the REQUEST HEADERS section (the X-ApiKey field is not required). Additionally, the JSON of the REQUEST BODY should include only the new password as shown in the “Change the user’s own password” option. Please note that it is not permitted to change any other user’s field.
The password must meet the following criteria for both creating and updating users:
The password will have an expiration time of 6 months, by default.
It is not a requisite to include an API key or JWT token in the header of the request.
The JWT token will be validated by OpenGate under the following conditions:
For you are authenticate in OpenGate you have to do LOG-IN to obtain a token JWT or an ApiKey:
Do you need an email and password.
flowchart TD
CU["CREATE User"] --> V{"Valid User"}
V -- No --> E400["ERROR 400<br>Json malformed"]
V -- "Yes, LOG-IN" --> LOGIN["Do LOG-IN<br>email and password"]
LOGIN --> VC{"Valid<br>email and password"}
VC -- No --> E401["ERROR 401<br>Bad credentials"]
VC -- Yes --> OK["Return: 200 OK<br>Return data (JWT and ApiKey)"]
classDef error fill:#f9d0d0,stroke:#c85a5a,color:#000
classDef ok fill:#a8ecd0,stroke:#2b9c6e,color:#000
class E400,E401 error
class OK ok
Do you need an email, password and an 2FA Code generated.
First, you have to configure your application to generate codes.
Configure your application
When you do login in OpenGate, the first time after configuring 2FA, the LOG-IN service responds with an error code 401, but in the headers contains an URL in the attribute location with the parameters of configuration.
You have to use this parameters to configure your application to generate the codes.
The URL of location will be like this otpauth://totp/2FA?secret=CAX3VP5O7GWZXUDWQOK4267DGXXSFIDQ&issuer=OpenGate&algorithm=SHA1&digits=6&period=30
Description of the attributes of the URL:
Some applications only need the secret field, and others need all parameters.
You can see the flow of this process in follow diagram:
flowchart TD
CU["CREATE or UPDATE USER<br>with 2FA"] --> V{"Valid User<br>with 2FA type"}
V -- No --> E400["ERROR 400<br>Json malformed"]
V -- "Yes, LOG-IN" --> LOGIN["Do LOG-IN<br>without 2FA Code"]
LOGIN --> FIRST{"First time"}
FIRST -- No --> E401A["ERROR 401<br>Bad Credentials<br>or Bad 2Fa Code sent"]
FIRST -- Yes --> HDR["Return: ERROR 401<br>Headers with URL 2FA"]
HDR --> APP["With URL - Configure APP"]
APP --> GEN["Generate 2FA code<br>with the application"]
GEN --> LOGIN2["Do LOG-IN with 2FA"]
LOGIN2 --> VC{"Valid<br>email and password"}
VC -- No --> E401B["ERROR 401<br>Bad Credentials"]
VC -- Yes --> EXP{"Code expired<br>Code invalid"}
EXP -- No --> OK["Return 200 OK<br>Return data (JWT and ApiKey)"]
EXP -- Yes --> E401C["401 ERROR<br>Invalid Code"]
classDef error fill:#f9d0d0,stroke:#c85a5a,color:#000
classDef ok fill:#a8ecd0,stroke:#2b9c6e,color:#000
classDef step fill:#addcf8,stroke:#2b7cb8,color:#000
class E400,E401A,E401B,E401C,HDR error
class OK ok
class LOGIN,APP,GEN,LOGIN2 step
Every 2FA failure returns 401 Unauthorized, so the error code is what tells the cases apart:
| Code | Situation | Context |
|---|---|---|
0x000065 |
First login after configuring 2FA. Read the location header to configure your application. |
2FA |
0x000065 |
2FA is configured but no code was sent. | 2FaCode is null |
0x000066 |
The code sent is invalid or expired. | 2FaCode |
0x000067 |
A code was sent but the user has no 2FA configured. Log in without the TOTP code. | 2FaCode |
An expired password is a different case: it returns 403 with code 0x010063.
OpenGate by default incorporates a set of user profiles which is listed below:
New adhoc user profiles can be added to adapt to specific needs.
rootsuper_admin_domainadmin_domainadminadvancedviewerrootTotal control for managing all resources in the platform
super_admin_domainsuper_admin_domain access to the Provision APIsuper_admin_domain access to the Search APIFull access.
super_admin_domain access to the Operation APIadmin_domainadmin_domain access to the Provision APIadmin_domain access to the Search APIFull access.
admin_domain access to the Operation APIadminadmin access to the Provision APIadmin access to the Search APIsFull access.
admin access to the Operation APIadvancedadvanced access to the Provision APIadvanced access to the Search APIFull access.
advanced access to the Operation APIviewerviewer access to the Provision APIviewer access to the Search APIFull access.
viewer access to the Operation APISoftware, firmware, configuration. You can rely on OpenGate to update the software, the firmware, or the configuration files of your remote devices.
The updates can be executed using the operations API, but first of all, OpenGate must know the structure of your update bundles.
The following sections show you how to feed OpenGate with your software, firmware, and configuration files.
A bundle is a group of deployment elements you want to deploy in a remote device. A bundle can contain four file types:
See Bundle Object
flowchart TD
START(("Start")) --> B["POST bundle"]
B --> DE["POST deployment element<br>to the bundle"]
DE --> Q{"Should the bundle have<br>more deployment elements?"}
Q -- Yes --> DE
Q -- No --> END(("End"))
classDef step fill:#addcf8,stroke:#2b7cb8,color:#000
classDef terminal fill:#a8ecd0,stroke:#2b9c6e,color:#000
class B,DE step
class START,END terminal
We want to make sure you understand the bundle management workflow, because the update operations will use your bundles.
First of all, you must POST a bundle.
Then you must upload, i.e. POST, as many deployment elements as the bundle should have.
Finally, you must set up the state bundle attribute to ACTIVE.
What is a deployment element? A bundle is formed by deployment elements, each of these elements can have files associated or not, depending on the operation associated with the deployment element. In a bundle, through the deployment elements, you can define different actions that you want to perform in the device, such as installing software, updating it, and more.
The operations allowed for a deployment element are:
See the structure of a deployment element object at Deployment Element
In order to attach a deployment element to a bundle in the OpenGate API, you must replace {bundle_name} and {version_name} with the identifiers of the bundle and version you want to attach the deployment element to. Because deployment elements need to be uploaded, this POST request differs from others in the OpenGate API. The request must be encoded according to RFC 1867, “Form-based File Upload in HTML”, which OpenGate can parse to “attach” the deployment element to the bundle.
When creating a deployment element, you have three options for attaching a file:
Filling only the downloadUrl field: In this case, the file will be located at the path provided in the downloadUrl field.
Attaching a file without filling the downloadUrl field: Here, the file is uploaded, and the downloadUrl field is automatically populated with the URL of the OpenGate internal file repository.
Attaching a file and filling the downloadUrl field: This option combines the previous two; the file is uploaded to the default path, and the device downloads the file from the path specified in the downloadUrl field.
You must upload at least one deployment element, or your bundle cannot be activated.
Additionally, there is an optional parameter called FileValidationRequired, which forces the platform to validate the file’s integrity. This parameter is only relevant when a valid validator parameter is passed within the accompanying JSON file.
Note that the deployment element file has a maximum size, which can be configured administratively. By default, this limit is set to 22,020,096 bytes.
For the POST request, you must include either the downloadUrl parameter, the associated file, or both.
There are two different ways for creating a bundle:
The zip file will have the next content:
You must replace {bundle_name} with the identifier of the bundle you want to update and {version_name} with the selected version to be updated.
You cannot update a bundle using the file option available in the create option.
You cannot update all the fields of a bundle. The following fields are allowed:
descriptionpreactionpostactionuserNotesactivedeployments elementsIf a bundle has been used in an update operation, you can only update the following fields:
descriptionuserNotesactiveSoftware, firmware, configuration. You can rely on OpenGate to update the software, the firmware, or the configuration files of your remote devices.
The updates can be executed using the operations API, but first of all, OpenGate must know the structure of your update bundles.
The following sections show you how to feed OpenGate with your software, firmware, and configuration files.
If a bundle has been used in an update operation, it can’t be deleted.