Tianyi Account AST Direct Authentication v7.1
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_990a4550/tianyi-ast-direct-auth-v7-1
About this skill
What It Solves
When business plugins or upstream skills need a Tianyi account idToken, direct API calls often lack a trusted authentication credential. This skill wraps Tianyi AST QR login and /ast/verify direct validation into one stable path, so each business does not re-implement QR polling, ticket status, and local session recovery.
How It Works
The core path is singular: complete direct authentication through /ast/verify, without gateway mode and without calling /ast/introspect.
- Read
direct_auth_init.jsonor explicit caller parameters. - Check
agent_session.jsonwith the bundled Python helper. - Resolve the business
appId; if the session is valid, call/ast/verify. - If the session is missing, expired, malformed, or near expiry, call
/ast/login/startand/ast/login/qrcode, then show the QR image and login link. - After the user confirms login, query
/ast/login/status/{ticket}. - On success, persist the local session and identity material, then call
/ast/verifyto returnidTokenandexpiresAt.
Boundaries
It is intended to be used by other skills or code plugins as an authentication dependency. Success requires the status endpoint to return success, agent_session.json to be saved, and direct authentication to return idToken and expiresAt. Do not expose agentSessionToken, private key material, signing plaintext, local file paths, or appId to the caller, and do not use it for refresh, logout, or gateway fallback.
Use Cases
- After a business API returns 401, re-authenticate the Tianyi account and obtain a usable `idToken`.
- A partner plugin supplies a business `appId` and needs to trigger Tianyi login to receive an `idToken`.
- A code plugin needs a stable CLI entrypoint to complete AST login and `/ast/verify` validation.
- When a user asks to log in to a Tianyi account, show the QR code and login link, then poll login status.
Best For
- Backend engineers who need an `idToken` for Tianyi business APIs.
- Business skill authors who want to reuse an authentication dependency without handling QR and ticket state.
- Plugin developers who need a CLI result to integrate Tianyi account authentication.
- Automation maintainers who need to inspect or reuse `agent_session.json`.
Related Skills
Analyzes code to extract control and data flow, then outputs Markdown with Mermaid source and high-resolution PNG diagrams.
For development and programming scenarios around VSCode and TypeScript IDE.
A TypeScript-oriented Windmill Wrap development reference.
A Python-based Selenium wrapper for engineering browser automation workflows.