AU

auth-http-api-cloudbase

Handles CloudBase Auth v2 via standard HTTP requests.

Install

mkdir -p .claude/skills/auth-http-api-cloudbase && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2905" && unzip -o skill.zip -d .claude/skills/auth-http-api-cloudbase && rm skill.zip

Installs to .claude/skills/auth-http-api-cloudbase

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when you need to implement CloudBase Auth v2 over raw HTTP endpoints (login/signup, tokens, user operations) from backends or scripts that are not using the Web or Node SDKs.
178 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Generate raw HTTP requests for CloudBase Auth endpoints
  • Manage token lifecycle without official SDKs
  • Handle environment-specific headers like x-device-id
  • Execute auth operations via curl or shell scripts

How it works

It provides standardized HTTP endpoint documentation and request patterns to facilitate direct backend interaction with CloudBase APIs.

Inputs & outputs

You give it
Auth operation type and target environment ID
You get back
HTTP request snippet or shell command

When to use auth-http-api-cloudbase

  • Authenticate non-Node backends
  • Implement auth in shell scripts
  • Manage tokens via custom proxy

About this skill

When to use this skill

Use this skill whenever you need to call CloudBase Auth via raw HTTP APIs, for example:

  • Non-Node backends (Go, Python, Java, PHP, etc.)
  • Integration tests or admin scripts that use curl or language HTTP clients
  • Gateways or proxies that sit in front of CloudBase and manage tokens themselves

Do not use this skill for:

  • Frontend Web login with @cloudbase/[email protected] (use CloudBase Web Auth skill)
  • Node.js code that uses @cloudbase/node-sdk (use CloudBase Node Auth skill)
  • Non-auth CloudBase features (database, storage, etc.)

How to use this skill (for a coding agent)

  1. Clarify the scenario

    • Confirm this code will call HTTP endpoints directly (not SDKs).
    • Ask for:
      • env – CloudBase environment ID
      • clientId / clientSecret – HTTP auth client credentials
    • Confirm whether the flow is login/sign-up, anonymous access, token management, or user operations.
  2. Set common variables once

    • Use a shared set of shell variables for base URL and headers, then reuse them across scenarios.
  3. Pick a scenario from this file

    • For login / sign-up, start with Scenarios 1–3.
    • For token lifecycle, use Scenarios 4–6.
    • For user info and profile changes, use Scenario 7.
  4. Never invent endpoints or fields

    • Treat the URLs and JSON shapes in this file as canonical.
    • If you are unsure, consult the HTTP API docs under /source-of-truth/auth/http-api/登录认证接口.info.mdx and the specific *.api.mdx files.

HTTP API basics

  • Base URL pattern

    • https://${env}.ap-shanghai.tcb-api.tencentcloudapi.com/auth/v1/...
  • Common headers

    • x-device-id – device or client identifier
    • x-request-id – unique request ID for tracing
    • AuthorizationBearer <access_token> for user endpoints
    • Or HTTP basic auth (-u clientId:clientSecret) for client-credential style endpoints
  • Reusable shell variables

env="your-env-id"
deviceID="backend-service-1"
requestID="$(uuidgen || echo manual-request-id)"
clientId="your-client-id"
clientSecret="your-client-secret"
base="https://${env}.ap-shanghai.tcb-api.tencentcloudapi.com/auth/v1"

Core concepts (HTTP perspective)

  • CloudBase Auth uses JWT access tokens plus refresh tokens.
  • HTTP login/sign-up endpoints usually return both access_token and refresh_token.
  • Most user-management endpoints require Authorization: Bearer ${accessToken}.
  • Verification flows (SMS/email) use separate verification endpoints before sign-up.

Scenarios (flat list)

Scenario 1: Sign-in with username/password

curl "${base}/signin" \
  -X POST \
  -H "x-device-id: ${deviceID}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{"username":"[email protected]","password":"your password"}'
  • Use when the user already has a username (phone/email/username) and password.
  • Response includes access_token, refresh_token, and user info.

Scenario 2: SMS sign-up with verification code

  1. Send verification code
curl "${base}/verification" \
  -X POST \
  -H "x-device-id: ${deviceID}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{"phone_number":"+86 13800000000"}'
  1. Verify code
curl "${base}/verification/verify" \
  -X POST \
  -H "x-device-id: ${deviceID}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{"verification_code":"000000","verification_id":"<from previous step>"}'
  1. Sign up
curl "${base}/signup" \
  -X POST \
  -H "x-device-id: ${deviceID}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{
    "phone_number":"+86 13800000000",
    "verification_code":"000000",
    "verification_token":"<from verify>",
    "name":"手机用户",
    "password":"password",
    "username":"username"
  }'
  • Use this pattern for SMS or email-based registration; adapt fields per docs.

Scenario 3: Anonymous login

curl "${base}/signin-anonymously" \
  -X POST \
  -H "x-device-id: ${deviceID}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{}'
  • Returns tokens for an anonymous user that you can later upgrade via sign-up.

Scenario 4: Exchange refresh token for new access token

curl "${base}/token" \
  -X POST \
  -H "x-device-id: ${deviceID}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{"grant_type":"refresh_token","refresh_token":"<refresh_token>"}'
  • Use when the frontend or another service sends you a refresh token and you need a fresh access token.

Scenario 5: Introspect and validate a token

curl "${base}/token/introspect?token=${accessToken}" \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}"
  • Use for backend validation of tokens before trusting them.
  • Response indicates whether the token is active and may include claims.

Scenario 6: Revoke a token (logout)

curl "${base}/revoke" \
  -X POST \
  -H "x-request-id: ${requestID}" \
  -u "${clientId}:${clientSecret}" \
  --data-raw '{"token":"${accessToken}"}'
  • Call when logging a user out from the backend or on security events.

Scenario 7: Basic user operations (me, update password, delete)

# Get current user
curl "${base}/user/me" \
  -H "Authorization: Bearer ${accessToken}"

# Change password
curl "${base}/user/password" \
  -X PATCH \
  -H "Authorization: Bearer ${accessToken}" \
  --data-raw '{"old_password":"old","new_password":"new"}'
  • Other endpoints:
    • DELETE ${base}/user/me – delete current user.
    • ${base}/user/providers plus bind/unbind APIs – manage third-party accounts.
  • Always secure these operations and log only minimal necessary data.

When not to use it

  • When the application uses Node.js or Web SDKs
  • For non-authentication related CloudBase features

Prerequisites

CloudBase environment IDClient credentials

Limitations

  • Requires manual header management
  • No protection against invalid endpoint usage if not checked against docs

How it compares

It enables low-level integration for non-SDK environments by exposing direct API call signatures instead of SDK method wrappers.

Compared to similar skills

auth-http-api-cloudbase side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
auth-http-api-cloudbase (this skill)18moReviewIntermediate
architecture-patterns552moNo flagsAdvanced
generating-grpc-services127dReviewAdvanced
ark-analysis04moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by TencentCloudBase

View all by TencentCloudBase

miniprogram-development

TencentCloudBase

WeChat Mini Program development rules. Use this skill when developing WeChat mini programs, integrating CloudBase capabilities, and deploying mini program projects.

3792

spec-workflow

TencentCloudBase

Standard software engineering workflow for requirement analysis, technical design, and task planning. Use this skill when developing new features, complex architecture designs, multi-module integrations, or projects involving database/UI design.

1091

ai-model-nodejs

TencentCloudBase

Use this skill when developing Node.js backend services or CloudBase cloud functions (Express/Koa/NestJS, serverless, backend APIs) that need AI capabilities. Features text generation (generateText), streaming (streamText), AND image generation (generateImage) via @cloudbase/node-sdk ≥3.16.0. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended), DeepSeek (deepseek-v3.2 recommended), and hunyuan-image for images. This is the ONLY SDK that supports image generation. NOT for browser/Web apps (use ai-model-web) or WeChat Mini Program (use ai-model-wechat).

59

web-development

TencentCloudBase

Web frontend project development rules. Use this skill when developing web frontend pages, deploying static hosting, and integrating CloudBase Web SDK.

514

ai-model-web

TencentCloudBase

Use this skill when developing browser/Web applications (React/Vue/Angular, static websites, SPAs) that need AI capabilities. Features text generation (generateText) and streaming (streamText) via @cloudbase/js-sdk. Built-in models include Hunyuan (hunyuan-2.0-instruct-20251111 recommended) and DeepSeek (deepseek-v3.2 recommended). NOT for Node.js backend (use ai-model-nodejs), WeChat Mini Program (use ai-model-wechat), or image generation (Node SDK only).

13

auth-tool-cloudbase

TencentCloudBase

Use CloudBase Auth tool to configure and manage authentication providers for web applications - enable/disable login methods (SMS, Email, WeChat Open Platform, Google, Anonymous, Username/password, OAuth, SAML, CAS, Dingding, etc.) and configure provider settings via MCP tools `callCloudApi`.

17

You might also like

architecture-patterns

wshobson

Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use when architecting complex backend systems or refactoring existing applications for better maintainability.

55214

generating-grpc-services

jeremylongshore

Generate gRPC service definitions, stubs, and implementations from Protocol Buffers. Use when creating high-performance gRPC services. Trigger with phrases like "generate gRPC service", "create gRPC API", or "build gRPC server".

13

ark-analysis

mckinsey

Analyze the Ark codebase by cloning the repository to a temporary location. Use this skill when the user asks questions about how Ark works, wants to understand Ark's implementation, or needs to examine Ark source code.

02

backend-expert

FlavioProgramador

Advanced backend engineering guidelines focusing on clean architecture, API standards, performance, asynchronous jobs, and clean code principles.

00

API service

TheBearIsOne

Use this skill when: - adding HTTP endpoints; - defining request and response models; - wiring document generation into an API surface; - shaping controller, route, or handler behavior.

00

senior-backend

Cor-Incorporated

Guides backend system development with Node.js, Express, Go, Python, PostgreSQL, GraphQL, and REST APIs. Use when the user says: 'design an API', 'optimize database queries', 'implement authentication', 'set up backend', 'create API endpoint', 'database migration', 'fix N+1 query', 'add rate limitin

00

Search skills

Search the agent skills registry