Skip to content

Commit de1fd8d

Browse files
authored
Merge pull request #23 from OS2iot/feature/1240_api-key-access
Update API key documentation
2 parents b21f95d + e70e813 commit de1fd8d

File tree

8 files changed

+30
-18
lines changed

8 files changed

+30
-18
lines changed

source/contents.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
iot-data-handling/iot-data-handling.rst
1818
downlink-helpers/downlink-helpers.rst
1919
kombit-adgangsstyring/kombit-adgangsstyring.rst
20-
api-key-access/api-key-access.rst
2120
audit-log/audit-log.rst
2221
testing/testing.rst
2322
exit-strategy/exit-strategy.rst

source/api-key-access/api-key-access.rst renamed to source/internal-interface-design/api-key-access.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
API key access
2-
====================
2+
----------------
33

44
OS2IoT supports API key authentification. This allows external clients to use the system without the need of a browser or a user.
55

66
Configuration
7-
-------------
7+
^^^^^^^^^^^^^
88

99
In order to use this type of authentication, an administrator must create an API key with one or more user groups.
1010
This can be done on the portal through the API key management pages. It can be accessed through the menu.
1111

1212

1313
Usage
14-
-----
14+
^^^^^
1515
With an API key, you can fetch and manage data in your OS2IoT system just as well as if you were a user on the browser.
1616
What you can access and manage is limited by the user group (-s) tied to the API key.
1717

@@ -31,7 +31,7 @@ As seen, the backend responded with 2 (collapsed) applications.
3131

3232

3333
Limitations
34-
-----------
34+
^^^^^^^^^^^
3535
While most of the system is accessible using API key authentication, there are some security limitations, however:
3636

3737
- You cannot manage your API key or someone else's

source/internal-interface-design/internal-interface-design.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ There is four levels of permissions in OS2IoT:
7676

7777
The permissions are hieratical, meaning that you implicitly have all lesser permissions than the ones you have explicitly.
7878
For instance, if a user is an Organization Admin for an Organization, then that user also have the Write and Read permissions.
79+
80+
.. include:: api-key-access.rst
File renamed without changes.

source/kombit-adgangsstyring/kombit-adgangsstyring.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Steps:
3131
a. Edit the file with a suiteable text editor, such as: VSCode, SublimeText or notepad++.
3232
b. Replace all instances of :code:`{YOUR_BASE_URL}` with your actual base url, i.e. :code:`test.os2iot.dk`.
3333
c. Replace all instances of :code:`{YOUR_PUBLIC_KEY_AS_BASE64}` with the base64 encoded part of the certificate (without newlines), i.e. :code:`<X509Certificate>MIIGJDCCBQygAwIBAgIEXd/ZTjANBgkqhkiG9w0BAQsFADBAMQswCQYDVQQGEwJESzESMBAGA1UECgwJVFJVU1QyNDA...=</X509Certificate>`
34-
(Tip: `{YOUR_PUBLIC_KEY_AS_BASE64}` is the extracted certificate)
34+
35+
(Tip: `{YOUR_PUBLIC_KEY_AS_BASE64}` is the extracted certificate)
3536

3637

3738
3. Create an IT-system in KOMBIT adgangsstrying:

source/software-architecture/software-architecture.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ Process perspective
5151
Receive IoT device data
5252
~~~~~~~~~~~~~~~~~~~~~~~
5353

54-
See the seperate page: `IoT Data management <../iot-data-handling/iot-data-handling.html`_.
54+
See the separate page: `IoT Data management`_.
55+
56+
.. _`IoT Data management`: ../iot-data-handling/iot-data-handling.html
5557

5658
Implementation perspective
5759
--------------------------
@@ -280,9 +282,15 @@ OS2iot REST API security
280282

281283
In order to use the REST API exposed by OS2iot, the user must be authenticated.
282284

283-
Authentication is done using the JWT gained from the :code:`/api/v1/auth/login` endpoint.
285+
There are two methods of authentication. The first method is done by using the JWT gained from the :code:`/api/v1/auth/login` endpoint.
284286
The JWT is inserted as a Bearer token in the :code:`Authorization` header of the type :code:`Bearer` as described in RFC 6750, section 2.1.
285287

288+
The second method of authentication involves using an API key generated on the :code:`/api/v1/api-key` endpoint.
289+
An API key is tied to one or more user groups so the access level reflects what each user group is permitted.
290+
It can be created by users with an organization administrator role or higher.
291+
292+
The API key is inserted as text in the :code:`X-API-KEY` header. Note that if a valid JWT token is provided, then API key authentication is skipped.
293+
286294
Device security
287295
~~~~~~~~~~~~~~~
288296

source/user-interface-design/ui-design.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ and the content is only boxed in with at .container-fluid class from Bootstrap,
5252
</div>
5353

5454
Boxed Feature width Layout
55-
^^^^^^^^^^^^^^^^^^^^^^^
55+
^^^^^^^^^^^^^^^^^^^^^^^^^^
5656

5757
|image2-1|
5858

@@ -219,9 +219,10 @@ Global search is used to search across entities in OS2IoT, this is done via free
219219
When searching in global search, the result is not displayed as in other searches, since in global search, several entities can be searched at the same time.
220220
The result is displayed instead on a single page where both the data type and selected data for this data type are displayed.
221221
The following entities are searchable via global search:
222-
- Applications
223-
- IoT-devices
224-
- Gateways
222+
223+
- Applications
224+
- IoT-devices
225+
- Gateways
225226

226227
|image4-1|
227228

@@ -233,11 +234,12 @@ For example, it will i.a. be possible to seek a application on the basis of the
233234
but not on e.g. the creation date, as searches on dates would otherwise yield too many irrelevant results.
234235
The picture below shows how the search result is presented.
235236
|image4-2|
236-
1) showing which icon the search has broad, separated into applications, units, and gateways,
237-
2) which type divided into Applications, Generic Http, Lorawan, Sigfox, and Gateways,
238-
3) showing the name,
239-
4) showing the id,
240-
5) showing which organization the item belongs to.
237+
238+
1) showing which icon the search has broad, separated into applications, units, and gateways,
239+
2) which type divided into Applications, Generic Http, Lorawan, Sigfox, and Gateways,
240+
3) showing the name,
241+
4) showing the id,
242+
5) showing which organization the item belongs to.
241243

242244
Help
243245
~~~~~~~~~~~~~

source/users-notes/users-notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ How to change chirpstacks admin password
2323
----------------------------------------
2424

2525
Step-by-step:
26-
############
26+
#############
2727

2828
1. Log in to the ChirpStack Application Server web interface using the default credentials
2929
2. Change the password of the admin user under: 'All users' -> 'admin' -> 'Change Password'

0 commit comments

Comments
 (0)