|
| 1 | +Tutorial |
| 2 | +======== |
| 3 | + |
| 4 | +The :ref:`cli` command allows you to interact with a SCIM server. |
| 5 | + |
| 6 | +Basic parameters |
| 7 | +---------------- |
| 8 | + |
| 9 | +In order to connect to a SCIM server you will need to pass the :option:`scim --url` parameter. |
| 10 | +You can also pass additional headers, such as authentication ones, with :option:`scim --url`. |
| 11 | + |
| 12 | +.. code-block:: shell |
| 13 | +
|
| 14 | + $ scim2 --url https://auth.example --header "Authorization: Bearer 12345" create user --user-name "[email protected]" |
| 15 | + { |
| 16 | + "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], |
| 17 | + "id": "2819c223-7f76-453a-919d-413861904646", |
| 18 | + |
| 19 | + "meta": { |
| 20 | + "resourceType": "User", |
| 21 | + "created": "2010-01-23T04:56:22Z", |
| 22 | + "lastModified": "2011-05-13T04:42:34Z", |
| 23 | + "version": 'W\\/"3694e05e9dff590"', |
| 24 | + "location": "https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646", |
| 25 | + }, |
| 26 | + } |
| 27 | +
|
| 28 | +However passing those parameters each time you use the command can be annoying. |
| 29 | +To make commands shorter, you can set those parameters once for all by using the :ref:`SCIM_CLI_URL <scim-url-scim_cli_url>` and :ref:`SCIM_CLI_HEADERS <scim-header-scim_cli_headers>` environment vars. |
| 30 | + |
| 31 | +.. code-block:: shell |
| 32 | +
|
| 33 | + $ export SCIM_CLI_URL="https://auth.example" |
| 34 | + $ export SCIM_CLI_HEADERS="Authorization: Bearer 12345" |
| 35 | + $ scim2 create user --user-name "[email protected]" |
| 36 | + { |
| 37 | + "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"], |
| 38 | + "id": "2819c223-7f76-453a-919d-413861904646", |
| 39 | + |
| 40 | + "meta": { |
| 41 | + "resourceType": "User", |
| 42 | + "created": "2010-01-23T04:56:22Z", |
| 43 | + "lastModified": "2011-05-13T04:42:34Z", |
| 44 | + "version": 'W\\/"3694e05e9dff590"', |
| 45 | + "location": "https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646", |
| 46 | + }, |
| 47 | + } |
0 commit comments