You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _source/_posts/2023-07-28-scim-workshop.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ Let's update the users in `seed_script.ts`. We'll also need to hardcode `externa
129
129
130
130
We'll also give each org an `apikey` set to a random string. Using a different key for each org helps our code ensure that no client can accidentally view or edit users belonging to another.
131
131
132
-
After those changes, here's how `seed.ts` will look:
132
+
After those changes, here's how `seed_script.ts` will look:
133
133
134
134
```ts
135
135
asyncfunction main() {
@@ -257,6 +257,8 @@ Finally, we are ready to get started! Let's work on our first CRUD endpoint.
257
257
258
258
Let's refer to the [SCIM spec](https://datatracker.ietf.org/doc/html/rfc7644#section-3.3) on creating a user. The spec says the IdP sends a POST request containing a "User" to the `/Users` endpoint to create a user. In response to the POST, the server signals a successful creation with an HTTP status code 201 (Created) and returns a representation of the user created. If the server determines that the creation of the requested user conflicts with existing users (e.g., a "User" resource with a duplicate "userName"), the server MUST return HTTP status code 409 (Conflict) with a "scimType" error code of "uniqueness," as per Section 3.12.
259
259
260
+
Our SCIM Server will define a user's uniqueness by their externalId and orgId. You can see how this is done below when we check for a duplicate user.
261
+
260
262
Our `/Users` endpoint can fulfill those requirements with the following code:
Sign up for [Postman](https://identity.getpostman.com/login) or sign in to your account, and configure it to communicate with your local instance of the Todo app.
412
415
413
-
In Postman, the request URL will be`http://localhost:3333/scim/v2/Users` if you're running the Todo app locally. In the Headers tab, add the key `Content-Type` and set its value to `application/scim+json`, and then add an additional key, `Authorization`, and set it to `Bearer 131313`.This bearer token value comes from the `apikey` variable set earlier in `seed.ts`.
416
+
In Postman, the request URL will be`http://localhost:3333/scim/v2/Users` if you're running the Todo app locally. In the Headers tab, add the key `Content-Type` and set its value to `application/scim+json`, and then add an additional key, `Authorization`, and set it to `Bearer 131313`.This bearer token value comes from the `apikey` variable set earlier in `seed_script.ts`.
@@ -690,7 +693,7 @@ The result lists all users in the database.
690
693
691
694
Let's look up whether any users in the Todo app have the email address `[email protected]`. Try sending a GET request with no body to `http://localhost:3333/scim/v2/Users?filter=userName eq "[email protected]"&startIndex=1&count=100` What result do you expect?
@@ -1063,7 +1066,7 @@ In the Sign-On Options tab of the SCIM Test App, give the app a helpful name in
1063
1066
1064
1067
IntheSign-OnOptionsdialogue, keepthedefaultsettings, asthesewon't be used by our app. Click the blue "Done" button at the bottom of the page.
1065
1068
1066
-
IntheProvisioningtaboftheapplication, clicktheConfigureAPIIntegrationbutton, checktheEnableAPIIntegrationbox. ProvidetheBaseURL, whichisthelocaltunnelURLwith`/scim/v2`appendedtotheend. TheAPITokenis`Bearer 131313`ifyou're using the values seeded by `seed.ts`. Save these settings.
1069
+
IntheProvisioningtaboftheapplication, clicktheConfigureAPIIntegrationbutton, checktheEnableAPIIntegrationbox. ProvidetheBaseURL, whichisthelocaltunnelURLwith`/scim/v2`appendedtotheend. TheAPITokenis`Bearer 131313`ifyou're using the values seeded by `seed_script.ts`. Save these settings.
1067
1070
1068
1071
Whenyousavethesesettingsorusethe"Test API Credentials"button, Oktawillmakea`GET /Users`requestwiththeAPItokenyou've provided in order to establish a connection with your SCIM server.
0 commit comments