docker run -p 8000:8000 harrykodden/scim
go to your browser and open window at:
http://localhost:8000
This image uses environment variables for configuration.
| Available variables | Description | Example | Default |
|---|---|---|---|
LOGLEVEL | The application logging level | ERROR | INFO |
API_KEY | The API key to authenticate with | API_KEY=jdjdjdjdehc04 | secret |
BASE_PATH | The base path of all API endpoints | /api/v2 | / |
DATA_PATH | File system path name | /mnt/scim | /tmp |
MONGO_DB | Mongo connection string | mongodb://user:password@mongo_host | mongodb://localhost:27017/ |
DATABASE_URL | SQL Database connection string | postgresql://user:password@postrgres_host:5432/mydb or mysql+pymysql://user:password@mysql_host/mydb | sqlite:///scim.sqlite |
The data that is received by this SCIM server can be handled in different ways. Below is an example on how to pick up specific attributes from the received data.
Suppose you have configured a MySQL database via the SQL Plugin configuration. Then your data will be persisted in 2 MySQL database tables Users and Groups. The structure of both tables are alike and have only 2 columnns
| id | details |
|---|---|
| unique uuid of this resource | this is a JSON datatype holding the data attributes of this resource |
For example after a provisiong the data for Users contains:
| id | details |
|---|---|
| 613277a6-aa52-440e-b604-9bbd14343558 | "{"userName": "hkodden5", "active": true, "externalId": "[email protected]", "name": {"familyName": "Kodden", "givenName": "Harry"}, "displayName": "Harry Kodden", "emails": [{"primary": true, "value": "[email protected]"}] ...}" |
Then you would like to retrieve specific values out of the JSON data.
You could do that for example by creating a view like this:
CREATE OR REPLACE VIEW MyUsers (id, details) AS select id, details->>"$" from Users;
CREATE OR REPLACE VIEW MyGroups (id, details) AS select id, details->>"$" from Groups;
Having these SQL Views in place, we can directly lookup specific values from the provisioned data. For example, we want to lookup the userName.
select id, details->>'$.userName' as userName from MyUsers where id = '613277a6-aa52-440e-b604-9bbd14343558';
will result in:
| id | userName |
|---|---|
| 613277a6-aa52-440e-b604-9bbd14343558 | hkodden5 |
Content type
Image
Digest
sha256:e75540ee0…
Size
479.2 MB
Last updated
2 days ago
docker pull harrykodden/scim