Skip to content

Commit 6b8782a

Browse files
committed
Add postman-scim-samples for OIG
1 parent fd0d713 commit 6b8782a

File tree

4 files changed

+380
-0
lines changed

4 files changed

+380
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Copyright (c) 2023 Oracle and/or its affiliates.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any
6+
person obtaining a copy of this software, associated documentation and/or data
7+
(collectively the "Software"), free of charge and under any and all copyright
8+
rights in the Software, and any and all patent rights owned or freely
9+
licensable by each licensor hereunder covering either (i) the unmodified
10+
Software as contributed to or provided by such licensor, or (ii) the Larger
11+
Works (as defined below), to deal in both
12+
13+
(a) the Software, and
14+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
15+
one is included with the Software (each a "Larger Work" to which the Software
16+
is contributed by such licensors),
17+
18+
without restriction, including without limitation the rights to copy, create
19+
derivative works of, display, perform, and distribute the Software and make,
20+
use, sell, offer for sale, import, export, have made, and have sold the
21+
Software and the Larger Work(s), and to sublicense the foregoing rights on
22+
either these or other terms.
23+
24+
This license is subject to the following condition:
25+
The above copyright notice and either this complete permission notice or at
26+
a minimum a reference to the UPL must be included in all copies or
27+
substantial portions of the Software.
28+
29+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
{
2+
"info": {
3+
"_postman_id": "2b5ecb24-88a5-4390-8246-0b848f6c6050",
4+
"name": "OIG_POSTMAN_SAMPLES",
5+
"description": "Copyright (c) 2023 Oracle and/or its affiliates.\n\nLicensed under the Universal Permissive License (UPL), Version 1.0.\n\nSee https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE for more details.",
6+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
7+
},
8+
"item": [
9+
{
10+
"name": "Get Authorization Token",
11+
"event": [
12+
{
13+
"listen": "test",
14+
"script": {
15+
"exec": [
16+
"//Retrieve access token\r",
17+
"pm.collectionVariables.set(\"access_token\",JSON.parse(responseBody).accessToken);"
18+
],
19+
"type": "text/javascript"
20+
}
21+
}
22+
],
23+
"request": {
24+
"auth": {
25+
"type": "basic",
26+
"basic": [
27+
{
28+
"key": "password",
29+
"value": "YourSecurePassword",
30+
"type": "string"
31+
},
32+
{
33+
"key": "username",
34+
"value": "xelsysadm",
35+
"type": "string"
36+
}
37+
]
38+
},
39+
"method": "POST",
40+
"header": [
41+
{
42+
"key": "Content-Type",
43+
"value": "application/json",
44+
"type": "text"
45+
},
46+
{
47+
"key": "X-Requested-By",
48+
"value": "me",
49+
"type": "text"
50+
}
51+
],
52+
"url": {
53+
"raw": "http://{{host}}:{{port}}/iam/governance/token/api/v1/tokens",
54+
"protocol": "http",
55+
"host": [
56+
"{{host}}"
57+
],
58+
"port": "{{port}}",
59+
"path": [
60+
"iam",
61+
"governance",
62+
"token",
63+
"api",
64+
"v1",
65+
"tokens"
66+
]
67+
}
68+
},
69+
"response": []
70+
},
71+
{
72+
"name": "Create Organization",
73+
"event": [
74+
{
75+
"listen": "test",
76+
"script": {
77+
"exec": [
78+
"//Retrieve org id\r",
79+
"pm.collectionVariables.set(\"organization_id\",JSON.parse(responseBody).id);"
80+
],
81+
"type": "text/javascript"
82+
}
83+
}
84+
],
85+
"request": {
86+
"method": "POST",
87+
"header": [
88+
{
89+
"key": "Content-Type",
90+
"value": "application/scim+json",
91+
"type": "text"
92+
},
93+
{
94+
"key": "X-Requested-By",
95+
"value": "Postman",
96+
"type": "text"
97+
},
98+
{
99+
"key": "Authorization",
100+
"value": "Bearer {{access_token}}",
101+
"type": "text"
102+
}
103+
],
104+
"body": {
105+
"mode": "raw",
106+
"raw": "{\r\n \"schemas\":\r\n [\r\n \"urn:ietf:params:scim:schemas:oracle:core:2.0:OIG:Organization\"\r\n ],\r\n \"urn:ietf:params:scim:schemas:oracle:core:2.0:OIG:Organization\":\r\n {\r\n \"name\": \"{{organization_name}}\",\r\n \"customerType\": \"Department\"\r\n }\r\n}",
107+
"options": {
108+
"raw": {
109+
"language": "json"
110+
}
111+
}
112+
},
113+
"url": {
114+
"raw": "http://{{host}}:{{port}}/iam/governance/scim/v1/Organizations",
115+
"protocol": "http",
116+
"host": [
117+
"{{host}}"
118+
],
119+
"port": "{{port}}",
120+
"path": [
121+
"iam",
122+
"governance",
123+
"scim",
124+
"v1",
125+
"Organizations"
126+
]
127+
}
128+
},
129+
"response": []
130+
},
131+
{
132+
"name": "Create Manager",
133+
"event": [
134+
{
135+
"listen": "test",
136+
"script": {
137+
"exec": [
138+
"//Retrieve manager id\r",
139+
"pm.collectionVariables.set(\"manager_id\",JSON.parse(responseBody).id);"
140+
],
141+
"type": "text/javascript"
142+
}
143+
}
144+
],
145+
"request": {
146+
"method": "POST",
147+
"header": [
148+
{
149+
"key": "Content-Type",
150+
"type": "text",
151+
"value": "application/scim+json"
152+
},
153+
{
154+
"key": "X-Requested-By",
155+
"type": "text",
156+
"value": "Postman"
157+
},
158+
{
159+
"key": "Authorization",
160+
"value": "Bearer {{access_token}}",
161+
"type": "text"
162+
}
163+
],
164+
"body": {
165+
"mode": "raw",
166+
"raw": "{\r\n \"schemas\":\r\n [\r\n \"urn:ietf:params:scim:schemas:core:2.0:User\",\r\n \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\",\r\n \"urn:ietf:params:scim:schemas:extension:oracle:2.0:OIG:User\"\r\n ],\r\n \"userName\": \"{{manager_login}}\",\r\n \"name\": {\r\n \"familyName\": \"{{manager_lastname}}\",\r\n \"givenName\": \"{{manager_firstname}}\"\r\n },\r\n \"displayName\": \"{{manager_firstname}} {{manager_lastname}}\",\r\n \"emails\":\r\n [\r\n {\r\n \"value\": \"{{manager_email}}\",\r\n \"type\": \"work\"\r\n }\r\n ],\r\n \"userType\": \"Full-Time\",\r\n \"urn:ietf:params:scim:schemas:extension:oracle:2.0:OIG:User\":\r\n {\r\n \"startDate\": \"2021-08-31T12:00:00.000+00:00\",\r\n \"homeOrganization\":\r\n {\r\n \"value\": \"{{organization_id}}\",\r\n \"$ref\": \"http://{{host}}:{{port}}/iam/governance/scim/v1/Organizations/{{organization_id}}\"\r\n }\r\n }\r\n}"
167+
},
168+
"url": {
169+
"raw": "http://{{host}}:{{port}}/iam/governance/scim/v1/Users",
170+
"protocol": "http",
171+
"host": [
172+
"{{host}}"
173+
],
174+
"port": "{{port}}",
175+
"path": [
176+
"iam",
177+
"governance",
178+
"scim",
179+
"v1",
180+
"Users"
181+
]
182+
}
183+
},
184+
"response": []
185+
},
186+
{
187+
"name": "Create User(s) CSV",
188+
"event": [
189+
{
190+
"listen": "test",
191+
"script": {
192+
"exec": [
193+
"pm.test(\"Create User\", function() {\r",
194+
" var jsonData = pm.response.json();\r",
195+
"});"
196+
],
197+
"type": "text/javascript"
198+
}
199+
}
200+
],
201+
"request": {
202+
"method": "POST",
203+
"header": [
204+
{
205+
"key": "Content-Type",
206+
"type": "text",
207+
"value": "application/scim+json"
208+
},
209+
{
210+
"key": "X-Requested-By",
211+
"type": "text",
212+
"value": "Postman"
213+
},
214+
{
215+
"key": "Authorization",
216+
"value": "Bearer {{access_token}}",
217+
"type": "text"
218+
}
219+
],
220+
"body": {
221+
"mode": "raw",
222+
"raw": "{\r\n \"schemas\":\r\n [\r\n \"urn:ietf:params:scim:schemas:core:2.0:User\",\r\n \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\",\r\n \"urn:ietf:params:scim:schemas:extension:oracle:2.0:OIG:User\"\r\n ],\r\n \"userName\": \"{{login}}\",\r\n \"name\": {\r\n \"familyName\": \"{{lastname}}\",\r\n \"givenName\": \"{{firstname}}\"\r\n },\r\n \"displayName\": \"{{firstname}} {{lastname}}\",\r\n \"emails\":\r\n [\r\n {\r\n \"value\": \"{{email}}\",\r\n \"type\": \"work\"\r\n }\r\n ],\r\n \"userType\": \"{{emptype}}\",\r\n \"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User\":\r\n {\r\n \"manager\":\r\n {\r\n \"value\": \"{{manager_id}}\",\r\n \"$ref\": \"http://{{host}}:{{port}}/iam/governance/scim/v1/Users/{{manager_id}}\"\r\n }\r\n },\r\n \"urn:ietf:params:scim:schemas:extension:oracle:2.0:OIG:User\":\r\n {\r\n \"startDate\": \"2021-08-31T12:00:00.000+00:00\",\r\n \"homeOrganization\":\r\n {\r\n \"value\": {{organization_id}},\r\n \"$ref\": \"http://{{host}}:{{port}}/iam/governance/scim/v1/Organizations/{{organization_id}}\"\r\n }\r\n }\r\n}"
223+
},
224+
"url": {
225+
"raw": "http://{{host}}:{{port}}/iam/governance/scim/v1/Users",
226+
"protocol": "http",
227+
"host": [
228+
"{{host}}"
229+
],
230+
"port": "{{port}}",
231+
"path": [
232+
"iam",
233+
"governance",
234+
"scim",
235+
"v1",
236+
"Users"
237+
]
238+
}
239+
},
240+
"response": []
241+
}
242+
],
243+
"event": [
244+
{
245+
"listen": "prerequest",
246+
"script": {
247+
"type": "text/javascript",
248+
"exec": [
249+
""
250+
]
251+
}
252+
},
253+
{
254+
"listen": "test",
255+
"script": {
256+
"type": "text/javascript",
257+
"exec": [
258+
""
259+
]
260+
}
261+
}
262+
],
263+
"variable": [
264+
{
265+
"key": "host",
266+
"value": "127.0.0.1"
267+
},
268+
{
269+
"key": "port",
270+
"value": "14000"
271+
},
272+
{
273+
"key": "access_token",
274+
"value": ""
275+
},
276+
{
277+
"key": "organization_id",
278+
"value": ""
279+
},
280+
{
281+
"key": "organization_name",
282+
"value": "IT"
283+
},
284+
{
285+
"key": "manager_id",
286+
"value": ""
287+
},
288+
{
289+
"key": "manager_login",
290+
"value": "DJONES"
291+
},
292+
{
293+
"key": "manager_firstname",
294+
"value": "Dora"
295+
},
296+
{
297+
"key": "manager_lastname",
298+
"value": "Jones"
299+
},
300+
{
301+
"key": "manager_email",
302+
"value": "[email protected]"
303+
}
304+
]
305+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Oracle Identity Governance SCIM Postman Samples
2+
3+
A Postman collection of sample SCIM API requests for Oracle Identity Governance (OIG) that showcases the ability to quickly create organizations, managers and users via SCIM API calls. Note that these samples are meant for reference only and are not intended for use in production systems.
4+
5+
## Pre-requisites
6+
7+
- The collection relies on collection variables in order to properly construct the SCIM queries. Before running any of the queries please ensure you update the `{{host}}` and `{{port}}` variables in order to point to the OIG environment you intend to use. In order to do that, access the "Variables" tab by first clicking on the Postman collection name. Feel free to also update the `{{organization_name}}` and manager user details as per your needs.
8+
9+
- Open the "Authorization" tab of the "Get Authorization Token" request and update the credentials with a valid username and password. Any user with OIG API access (system administrators) can be used.
10+
11+
## Executing the queries
12+
13+
- Make sure you run the queries in sequence, as you will first need a valid `{{access_token}}`, then a valid `{{organization_id}}` to create the manager and reportees from the sample CSV file.
14+
15+
- Use the "Run Collection" batch functionality in Postman on the "Create User(s) CSV" request in order to import all the sample user entries in the provided CSV file (or from one of your own choosing). Note that the sample CSV file and all user names are provided only for reference. Any similarity to actual persons is purely coincidental and unintended.
16+
17+
## References
18+
19+
Oracle Identity Governance SCIM API reference: https://docs.oracle.com/en/middleware/idm/identity-governance/12.2.1.4/omdev/using-scim-rest-services.html
20+
21+
Postman collections guide: https://learning.postman.com/docs/collections/collections-overview/
22+
23+
# License
24+
25+
Copyright (c) 2023 Oracle and/or its affiliates.
26+
27+
Licensed under the Universal Permissive License (UPL), Version 1.0.
28+
29+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/folder-structure/LICENSE) for more details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
login,firstname,lastname,email,emptype
2+
LSCHULTE,Lothur,Schulte,[email protected],Full-Time
3+
GKLEIN,Gerrit,Klein,[email protected],Full-Time
4+
LDERICHS,Lutz,Derichs,[email protected],Full-Time
5+
HSCHUMACHER,Helene,Schumacher,[email protected],Full-Time
6+
GVOGT,Gitta,Vogt,[email protected],Full-Time
7+
EBRANDT,Ewald,Brandt,[email protected],Contractor
8+
RPROTZ,Rosemarie,Protz,[email protected],Contractor
9+
WSCHUBERT,Wolf,Schubert,[email protected],Full-Time
10+
BFRANK,Bernd,Frank,[email protected],Full-Time
11+
DSTAUSS,Dirk,Stauss,[email protected],Full-Time

0 commit comments

Comments
 (0)