一键导入
team-management
A language-agnostic guide for implementing secure, scalable team and organization management using SSOJet APIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
A language-agnostic guide for implementing secure, scalable team and organization management using SSOJet APIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Implement Machine-to-Machine (M2M) authentication using SSOJet OAuth2 Client Credentials flow for backend services and daemons.
Implement "Sign in with SSO" in native Android/Kotlin applications using SSOJet OIDC with AppAuth.
Implement "Sign in with SSO" in Angular SPA applications using SSOJet OIDC with PKCE.
Implement "Sign in with SSO" in ASP.NET Core applications using SSOJet OIDC middleware.
Implement "Sign in with SSO" in Go applications using SSOJet OIDC Authorization Code flow.
Implement "Sign in with SSO" in native iOS/Swift applications using SSOJet OIDC with AppAuth.
| name | team-management |
| description | A language-agnostic guide for implementing secure, scalable team and organization management using SSOJet APIs. |
The user is already authenticated using SSOJet OIDC (Authorization Code flow).
This skill guides developers to implement secure, scalable team and organization management using SSOJet APIs, following best coding practices and working across any language or framework (Next.js, Golang, .NET, Node.js, etc.).
Enable developers to build B2B SaaS team management by correctly handling:
Language-agnostic
Separation of concerns
Token safety
Explicit tenant context
Client Identification
client_id as a query parameter.?client_id=<management_client_id>Use Client Credentials Grant with sys_owner scope.
{
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"grant_type": "client_credentials",
"scope": "sys_owner"
}
Best practices
POST /api/v1/oauth2/token/api/v1 prefix (e.g., https://api.ssojet.com/api/v1).From the user’s OIDC access token, extract:
sub → user IDDo not assume tenant membership from the token alone.
To get all organizations the user belongs to, call:
GET /users/{userId}/tenants
API Reference: List User Tenants
"Returns a complete list of all tenants the user is a member of, along with their associated roles and context within each tenant."
Rules
This is the critical "fork in the road" for B2B apps.
tenant_id in the frontend session/cookie.Call Create Tenant API (POST /tenants).
{
"name": "string",
"display_name": "string",
"domains": [ "string" ]
}
API Reference: Create Tenant
Call Add User to Tenant API (POST /tenants/{id}/users).
{
"user_ids": ["current_user_id"]
}
API Reference: Add Users to Tenant
Call List All Roles API (GET /roles) to find the Owner role ID.
API Reference: List All Roles
Call Assign User Roles API (POST /tenants/{id}/users/{uid}/roles).
{
"role_ids": ["owner_role_id"]
}
API Reference: Assign User Roles
Auto-select the new tenant and proceed to the dashboard.
Your system must support:
Recommended request context
user_id
selected_tenant_id
role_in_tenant
To list all users in a selected tenant, use the endpoint that matches your authentication context:
Use the JWT obtained during the OIDC login flow. This endpoint returns roles specific to the tenant context.
GET/auth/tenants/{tenantId}/usersAuthorization: Bearer {User_Access_Token}Use this if you are performing administrative tasks without a user context.
GET/tenants/{tenantId}/usersAuthorization: Bearer {Management_Token}Display Requirements:
To provide a complete "Team Members" view, combine data from two sources:
is_active: true.GET /tenants/{id}/invitations?status=pending using the Management Token.Implementation Note: Standardize both responses into a shared model for the UI.
Provide a backend endpoint that:
invitee: { email: "..." }inviter: { user_id: "...", email: "..." } (Required)role_ids: ["..."]send_invitation_email: trueexpire_in_minutes: 10080 (7 days)POST /tenants/{tenantid}/invitations
API Reference: Invite Team Member
"Generates a new onboarding invitation for a user to join the tenant workspace. This process creates a secure invitation token, associates it with the tenant, and dispatches an invitation email."
Allow only authorized roles to remove members. The removal logic depends on the member's status:
To remove an active user from the tenant, use the bulk delete endpoint:
DELETE/tenants/{tenantid}/users{
"user_ids": ["userId"]
}
To cancel or remove a pending invitation, use the invitation delete endpoint:
DELETE/tenants/{tenantid}/invitations?invitation_id={invitationId}Best practices
Use the Roles API to:
GET /roles
API Reference: List All Roles
"Retrieves a list of all defined roles within the system."
To ensure a professional B2B experience, follow these UI patterns:
The agent must always:
The agent should:
❌ Calling management APIs from frontend ❌ Assuming a single tenant per user ❌ Trusting JWT tenant data blindly ❌ Hardcoding roles or tenant IDs
/users/{userId}/tenants/tenants/{tenantId}/users