-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use EndpointRequestSnippet / EndpointResponseSnippet
- Loading branch information
Showing
4 changed files
with
36 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,8 +51,31 @@ paths: | |
x-fern-sdk-group-name: scim | ||
x-fern-sdk-method-name: listSCIMUsers | ||
x-fern-examples: | ||
- query-parameters: | ||
- name: List Users | ||
query-parameters: | ||
organizationExternalId: my_custom_external_id | ||
response: | ||
body: | ||
scimUsers: | ||
- id: scim_user_... | ||
email: [email protected] | ||
deleted: false | ||
attributes: | ||
displayName: John Doe | ||
preferredLanguage: en_US | ||
key: value | ||
- id: scim_user_... | ||
email: [email protected] | ||
deleted: true | ||
attributes: | ||
displayName: Jane Doe | ||
preferredLanguage: fr_FR | ||
key: value | ||
nextPageToken: "..." | ||
- name: Filter Users by Group ID | ||
query-parameters: | ||
organizationExternalId: my_custom_external_id | ||
scimGroupId: scim_group_... | ||
response: | ||
body: | ||
scimUsers: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,40 +49,12 @@ https://yourcompany.com/ssoready-callback?saml_access_code=saml_access_code_... | |
Your backend then exchanges that SAML access code for details about the user | ||
logging in: | ||
|
||
<CodeBlocks> | ||
<EndpointRequestSnippet endpoint="POST /v1/saml/redeem" /> | ||
|
||
```bash title="cURL" | ||
curl https://api.ssoready.com/v1/saml/redeem \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer ssoready_sk_..." \ | ||
-d '{ "samlAccessCode": "saml_access_code_..." }' | ||
``` | ||
|
||
```typescript title="TypeScript" | ||
const ssoready = new SSOReadyClient(); | ||
await ssoready.saml.redeemSamlAccessCode({ | ||
samlAccessCode: "saml_access_code_...", | ||
}); | ||
``` | ||
|
||
```python title="Python" | ||
client = SSOReady() | ||
client.saml.redeem_saml_access_code( | ||
saml_access_code="saml_access_code_...", | ||
) | ||
``` | ||
|
||
</CodeBlocks> | ||
|
||
You'll get back details about user that look like this: | ||
|
||
```json | ||
{ | ||
"email": "[email protected]", | ||
"organizationId": "org_7cu5hsy9vrbi5d2k1qvbh19lj", | ||
"organizationExternalId": "my_custom_external_id" | ||
} | ||
``` | ||
<EndpointResponseSnippet endpoint="POST /v1/saml/redeem" /> | ||
|
||
The rest of this document is about where you go from here. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,50 +55,22 @@ that your customer populates. To sync users, you'll: | |
|
||
To list SCIM users out of SSOReady, run: | ||
|
||
```bash | ||
curl 'https://api.ssoready.com/v1/scim/users?organization_external_id=...' \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer ssoready_sk_..." | ||
``` | ||
<EndpointRequestSnippet endpoint="GET /v1/scim/users" /> | ||
|
||
That code sample requires an API Key (`ssoready_sk_...`) and an | ||
`organization_external_id`. How you get those is covered in [Setting up | ||
SSOReady](#setting-up-ssoready) later on this page. | ||
|
||
You'll get back a response that looks like this: | ||
|
||
```json | ||
{ | ||
"users": [ | ||
{ | ||
"id": "scim_user_...", | ||
"email": "[email protected]", | ||
"deleted": false, | ||
"attributes": {} | ||
}, | ||
{ | ||
"id": "scim_user_...", | ||
"email": "[email protected]", | ||
"deleted": true, | ||
"attributes": {} | ||
} | ||
], | ||
"nextPageToken": "..." | ||
} | ||
``` | ||
<EndpointResponseSnippet endpoint="GET /v1/scim/users" /> | ||
|
||
If the response contains a `nextPageToken` whose value is empty (i.e. the empty | ||
string, `""`), then you have reached the end of the list. | ||
|
||
If `nextPageToken` is non-empty, there is more data to fetch. You can fetch the | ||
next page of data by re-running your previous request, but setting the parameter | ||
`pageToken` to the value of `nextPageToken` you just got back: | ||
|
||
```bash | ||
curl 'https://api.ssoready.com/v1/scim/users?organization_external_id=...&page_token=...' \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer ssoready_sk_..." | ||
``` | ||
`pageToken` to the value of `nextPageToken` you just got back. | ||
|
||
### Provisioning (creating) users | ||
|
||
|
@@ -240,52 +212,18 @@ group-specific concept. | |
|
||
To list SCIM groups out of SSOReady, run: | ||
|
||
```bash | ||
curl 'https://api.ssoready.com/v1/scim/groups?organization_external_id=...' \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer ssoready_sk_..." | ||
``` | ||
<EndpointRequestSnippet endpoint="GET /v1/scim/groups" /> | ||
|
||
You'll get back a response that looks like this: | ||
|
||
```json | ||
{ | ||
"scimGroups": [ | ||
{ | ||
"id": "scim_group_...", | ||
"scimDirectoryId": "scim_directory_...", | ||
"displayName": "Engineering", | ||
"deleted": false, | ||
"attributes": { | ||
"displayName": "Engineering" | ||
} | ||
}, | ||
{ | ||
"id": "scim_group_...", | ||
"scimDirectoryId": "scim_directory_...", | ||
"displayName": "Marketing", | ||
"deleted": true, | ||
"attributes": { | ||
"displayName": "Marketing" | ||
} | ||
} | ||
], | ||
"nextPageToken": "..." | ||
} | ||
``` | ||
<EndpointResponseSnippet endpoint="GET /v1/scim/groups" /> | ||
|
||
If the response contains a `nextPageToken` whose value is empty (i.e. the empty | ||
string, `""`), then you have reached the end of the list. | ||
|
||
If `nextPageToken` is non-empty, there is more data to fetch. You can fetch the | ||
next page of data by re-running your previous request, but setting the parameter | ||
`page_token` to the value of `nextPageToken` you just got back: | ||
|
||
```bash | ||
curl 'https://api.ssoready.com/v1/scim/groups?organization_external_id=...&page_token=...' \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer ssoready_sk_..." | ||
``` | ||
`page_token` to the value of `nextPageToken` you just got back. | ||
|
||
### Provisioning (creating) groups | ||
|
||
|
@@ -350,11 +288,7 @@ To list users that are members of a group, you can provide a `scim_group_id` | |
parameter when listing SCIM users, using the same method as documented in | ||
[Listing users](#listing-users) above: | ||
|
||
```bash | ||
curl 'https://api.ssoready.com/v1/scim/users?organization_external_id=...&scim_group_id=scim_group_...' \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer ssoready_sk_..." | ||
``` | ||
<EndpointRequestSnippet endpoint="GET /v1/scim/users" example="Filter Users by Group ID" /> | ||
|
||
You need to provide the SSOReady-assigned `id` for the SCIM Group, beginning | ||
with `scim_group_...`, as the `scim_group_id`. | ||
|