Suitable scenarios: You are building a third-party application / Agent / MCP client / automation workflow, and want users to sign in with their Ace Data Cloud accounts with one click, and access their resources on the platform as needed, without requiring users to manually copy and paste API Keys.
Terminology & Endpoint Quick Reference
All endpoints are athttps://auth.acedata.cloud, and the latest addresses can always be obtained through the discovery endpoint (Discovery):
Supported capabilities:
response_type=code, grant_types=authorization_code, refresh_token, code_challenge_methods=S256, plain, client authentication methods client_secret_post (confidential clients) / none (PKCE public clients).
Permission Scopes (Scope)
Request according to the “least privilege” principle. Users will see every permission you request on the authorization page. Identity-related (OIDC compatible)
Platform resource-related
Aggregated (automatically expanded)
Special
Typical combinations: third-party “one-click login” =openid profile; MCP / IDE clients that need to automatically configure Keys =openid profile credentials:read credentials:write; full management console =openid profile email platform offline_access.
Step 1: Register an OAuth Application
Open auth.acedata.cloud/user/oauth-apps → “Create Application”, and fill in:- Application name / description / Logo: These will be displayed on the user’s authorization consent page.
- Client Type:
- Confidential——you have a backend and can securely store
client_secret(Web services, backend services). - Public——pure frontend / desktop / CLI / mobile, cannot securely store secrets, and must use PKCE.
- Confidential——you have a backend and can securely store
- Redirect URIs: The addresses to which users are redirected after authorization is completed. They must exactly match the
redirect_uriyou pass when initiating authorization. Multiple addresses can be entered. - Scopes: Select the scopes you need from the previous section.
client_id; confidential clients will also display the client_secret only once—save it immediately, as it cannot be viewed again after closing (you can regenerate it through “Rotate Secret” on the details page, and the old secret will become invalid immediately).
Each account can create up to 20 OAuth applications.
Step 2: Redirect the User to the Authorization Page
In your application, redirect the user’s browser to the authorization page with query parameters:state: Generate a random string yourself. It is returned unchanged in the callback and is used to prevent CSRF. Be sure to validate it.- PKCE (required for public clients, also recommended for confidential clients): First generate a random
code_verifier, then calculatecode_challenge = BASE64URL( SHA256( code_verifier ) ), putcode_challengeinto the authorization URL, and keepcode_verifierfor use in Step 4.
<redirect_uri>?error=access_denied&error_description=...&state=....
The authorization code is valid for 10 minutes and can only be used once.
Step 3: Exchange the Authorization Code for Tokens
In your backend (confidential client) or client (PKCE public client), usecode to call the token endpoint.
Confidential client (with client_secret):
refresh_token appears only when offline_access was requested):
access_token is a JWT containing the scope claim; it is valid for 15 days (expires_in in seconds). The Refresh Token is valid for 30 days.
Step 4: Call APIs with the Access Token
Put the token in theAuthorization: Bearer header.
Read user information (UserInfo, fields filtered by authorized scopes):
platform.acedata.cloud, authorized by scope). For example, if credentials:read has been granted:
scope claim in the JWT—the token can only access resources authorized by the user. Accessing unauthorized resources returns 403.
Refresh Tokens
After the Access Token expires, use the Refresh Token to exchange for a new pair of tokens (offline_access must have been requested initially):
Revoke Tokens
Real Example: This Is How Our Own MCP Servers Are Connected
The “Sign in with Ace Data Cloud” connections appearing in Claude Desktop / Cursor for Ace Data Cloud’s 15+ MCP servers (NanoBanana, Midjourney, Suno, Seedance, Kling…) use this exact flow: they are all registered as public (PKCE) OAuth applications, requestcredentials-related scopes, and after user authorization, the MCP servers can call api.acedata.cloud on behalf of the user—without requiring users to manually paste an API Key. Your integration is exactly the same as theirs.
Common Errors
Error responses are uniformly formatted as{ "error": "<code>", "error_description": "<human-readable description>" }:
Quick Reference for Limits
Embed Third-Party OAuth Applications on the Studio Homepage
OAuth can be enabled in Studio under “Settings → Homepage → Website Components” by configuring the third-party application’sclient_id and registered callback URL.
The website and callback must use HTTPS, have the same origin (scheme, domain, and port), and use a different origin from Studio.
Do not enter client_secret in the configuration; the application secret can only be stored in the third-party backend.
The component requests the profile:read credentials:read permissions. Each visitor must provide consent separately; the site owner configuring the component does not represent visitor authorization.
The third-party page generates a random state and PKCE verifier, and sends an S256 challenge to Studio. Studio hosts the official authorization page within the component area,
and after the user consents, the third party receives a one-time authorization code and calls the token endpoint to exchange it for an OAuth access token, then accesses
GET https://platform.acedata.cloud/api/v1/credentials/?user_id=<user ID> to read the existing API Key.
The user ID comes from the id returned by GET https://auth.acedata.cloud/api/v1/users/me in the previous step; the credentials list API does not accept user_id=me.
Studio does not send its own login token to third parties or directly read and inject the user’s Key.
Public clients must use S256 PKCE. When exchanging for a token, you must pass the exact same redirect_uri as in the authorization request.
An authorization code can only be exchanged once. The callback URL is checked to ensure it has been registered before authorization.
Third-party pages must implement the messaging protocol; any existing webpage cannot be integrated automatically merely by entering a URL.
For a complete example, see the Studio OAuth Component Integration Guide.
Authorizing the reading of API Keys means allowing the third party to store and use those Keys. Revoking OAuth authorization does not invalidate Keys already copied by the third party;
users must separately revoke or rotate the Keys.
