Sign inSign up

harrykodden/scim

By harrykodden

Updated 2 days ago

Image
0

2.8K

harrykodden/scim repository overview

Starting the application

docker run -p 8000:8000 harrykodden/scim

go to your browser and open window at:

http://localhost:8000

Environment variables

This image uses environment variables for configuration.

Available variablesDescriptionExampleDefault
LOGLEVELThe application logging levelERRORINFO
API_KEYThe API key to authenticate withAPI_KEY=jdjdjdjdehc04secret
BASE_PATHThe base path of all API endpoints/api/v2/
DATA_PATHFile system path name/mnt/scim/tmp
MONGO_DBMongo connection stringmongodb://user:password@mongo_hostmongodb://localhost:27017/
DATABASE_URLSQL Database connection stringpostgresql://user:password@postrgres_host:5432/mydb or mysql+pymysql://user:password@mysql_host/mydbsqlite:///scim.sqlite

Handling data

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.

Example on MySQL

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

iddetails
unique uuid of this resourcethis is a JSON datatype holding the data attributes of this resource

For example after a provisiong the data for Users contains:

iddetails
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:

iduserName
613277a6-aa52-440e-b604-9bbd14343558hkodden5

Tag summary

Content type

Image

Digest

sha256:e75540ee0

Size

479.2 MB

Last updated

2 days ago

docker pull harrykodden/scim