/api/resource-server/users/{uid}/organizationsAuthenticatedList a user's organization memberships
Tells a resource server which organizations a user belongs to, with their role in each, in the shape of GET /api/me/organizations. The calling API server names itself in the X-Api-Server-Id header, proves it with a single-use JWKS access assertion, and forwards the user's access token for the API server in X-Subject-Token: a resource server can only list the memberships of a user who is currently signed in to it. Only memberships the API server may see are returned: its owning organization's, or every organization's when a platform administrator set its organization membership visibility to all_organizations (PUT /api/apis/{api_server_id}/organization-membership-visibility). Resource servers built on @schemavaults/auth-server-sdk call this through listUserOrganizations() (or ctx.auth.listOrganizationMemberships() in operation handlers).
get_api_resource_server_users_uid_organizationsResource serversAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- JWKS access assertion (Bearer)
Authorization: Bearer <JWT>
- JWKS access assertion (Bearer)
- Who may call
- Any authenticated user
- Notes
- The assertion must be signed by the API server named in
X-Api-Server-Id; every assertion is accepted once.X-Subject-Tokenmust be an active access token ofuidfor that API server (403 otherwise).
Path parameters
| Name | Type | Description |
|---|---|---|
| uid* | string (uuid) | User id to list the memberships of; must be the subject of |
Request headers
| Name | Type | Description |
|---|---|---|
| x-api-server-id* | string | Id of the calling API server; the assertion must be signed with its JWKS access key |
| x-subject-token* | string | The user's access token for the calling API server, exactly as it was presented to the resource server: a JWE in compact serialization of at most 4096 characters |
Responses
| Property | Type | Description |
|---|---|---|
| success* | true | |
| data* | object | |
| uid* | string (uuid) | |
| organization_membership_visibility* | "owning_organization" | "all_organizations" | The calling API server's visibility: |
| memberships* | OrganizationMembershipRoleDetails[] | The user's memberships the API server may see (empty when the user no longer exists) |
| organization_id* | string | minLength: 4maxLength: 32pattern: ^[a-z][a-z0-9_-]+$ |
| organization_name* | string | minLength: 1maxLength: 64pattern: ^[a-zA-Z0-9]([a-zA-Z0-9 _-]*[a-zA-Z0-9])?$ |
| role* | string | |
| created_at* | integer | minimum: 0 |
| joined_at* | integer | minimum: 0 |
Example request
curl -X GET 'https://auth.schemavaults.com/api/resource-server/users/<uid>/organizations' \
-H 'Authorization: Bearer <access_token>' \
-H 'x-api-server-id: <x-api-server-id>' \
-H 'x-subject-token: <x-subject-token>'