Download and install Docker Desktop.
-
Clone repository
-
In root of repository run script
./build-container.sh
and wait for an inscriptionBuild finished
- Go to the Keycloak on
localhost:9001
:
- Go to the section
Administration Console
:
- Sign in with username
admin
and passwordadmin
:
- Go to the section
Master
and pressAdd realm
button:
- Name realm
iot
, pressSelect file
button, choose from repository folderkeycloak/realmdata
filerealm-iot.json
and pressCreate
button:
- Go to the section
Iot
and chooseMaster
section:
- Go to the section
Clients
:
- Press on
admin-cli
:
- Choose
Access Type
and change frompublic
toconfidential
, turn onService Accounts Enabled
and pressSave
button below:
- Press on
Service Account Roles
:
- Choose
Client Roles
and selectiot-realm
:
- In
Available Roles
choosemanage-users
,query-users
,view-users
and pressAdd selected >>
:
- Press on
Credentials
and copySecret
value (or pressRegenerate Secret
button and then copySecret
value):
- Go to the section
Master
and chooseIot
section:
- Go to the section
Clients
:
- Press on
iot-rest-api
:
- Press on
Credentials
and copySecret
value (or pressRegenerate Secret
button and then copySecret
value):
-
Close Keycloak
-
Stop and delete container in Docker Desktop and delete image
backend
(IMPORTANT!!!)
- In repository folder
env.d
open filebackend
and paste saved secret intoKEYCLOAK_ADMIN_CLIENT_SECRET
andKEYCLOAK_IOT_CLIENT_SECRET
variables:
# SOME ENVIROMENT VARIABLES
# ...
KEYCLOAK_ADMIN_CLIENT_SECRET=<YOUR_SAVED_ADMIN_CLIENT_SECRET>
KEYCLOAK_IOT_CLIENT_SECRET=<YOUR_SAVED_IOT_CLIENT_SECRET>
- In root of repository run script
./build-container.sh
and wait for an inscriptionBuild finished
Now backend is must be ready for REST API requests (for detail information about backend API, read API-DOC