YOS-Pass Unified Identity Authentication
Fill in one form and get production-ready integration code
access_token, you must verify the JWT on your server and enforce the exp claim (tokens without a valid exp are always rejected). See the Dev Reference below.
How it works (30 seconds)
The login flow has four steps. The QR code expires in 150 seconds; the front end polls every 2 seconds.
Integration Code Generator
Fill in the form, click "Generate", then copy or download. This page never saves any data you enter — nothing is persisted after you close it.
app_secret must live only on the server — never expose it in front-end pages or apps. Mode A (front-end one-click login) is the easy path: the page only needs the access card app_key; the key app_secret is signed server-side by the qrcode service and never appears in generated code. Use Mode B for production (credentials stay on your server). This page saves nothing you enter (no localStorage / sessionStorage / cookie).
yoshost_ prefix), then come back and fill it in. Not registered yet? Contact the administrator to register. The app_key and app_secret are shown only once — save them carefully. The key is hosted by the qrcode service; Mode A needs only the card.
app_key: yosapp_4b02c8fed312b55a7b13a1d0b136cf40
app_secret: c9f4efab14073ad240456d8c63bf55c72bee44c28c790816398a6b5dfb59c96c
These are samples for format reference only. Complete hosting registration to get your own credentials for real use.
What you need to do
- Get the access card: complete hosting registration to obtain your access card
app_key(yoshost_prefix). The keyapp_secretis hosted server-side — the front end never handles it. - Generate code: fill in the generator above, pick a mode, click "Generate Code".
- Deploy it: copy the code or download the file to your server (static directory for the HTML mode, PHP site for the PHP mode).
- User scans: the user scans the QR code with the YOS IOA App and taps Confirm.
- Done: on success the page redirects and your server verifies the
access_token(don't forget theexpcheck).
Integration Guide (exported with docs)
Click "Export Guide" to download a Markdown file containing the explanation below plus your generated code.
- Mode A — Front-end one-click login: the page only needs the access card
app_keyto callhttps://auth.ycceo.com/qrcode/yoslogin.php. The keyapp_secretis signed server-side. The interface generates the QR code; your page just shows it, polls status, and redirects on success. - Mode B — PHP server-side integration: your server signs the request body with HMAC-SHA256 (
app_key + app_secret) and callshttps://auth.ycceo.com/YOS-Pass/api/start_login.phpwith theX-Request-Signatureheader; the front end pollshttps://auth.ycceo.com/YOS-Pass/api/session_status.php; your server verifiesaccess_tokenwithverifyYosToken()(standard base64, signing inputheaderB64.payloadB64, key = yourapp_secret, exp enforced).
FAQ
Why "verify on server + enforce exp"?
access_token is a standard JWT — anyone can decode the payload. If you only decode it on the front end, you hand the auth decision to the attacker. Verify on your server with the secret, and enforce exp: reject missing or expired tokens to prevent "eternal tokens".Can app_secret be placed on the front end?
app_secret is your key — putting it in the front end is like leaving the key in the door. Mode A is designed for this: the key is hosted server-side, and the front end only sends the access card app_key to https://auth.ycceo.com/qrcode/yoslogin.php. In Mode B the key must stay on your server.How long is the QR code valid? What if it expires?
How do I get user info after login?
access_token (JWT) payload carries user identifiers (such as uid / openid / user_info). After your server verifies the token, read the decoded payload. Never trust a client-side decode that skipped verification.The QR code doesn't show / keeps loading?
qrcode.min.js can load (opening via file:// may be blocked); ② network access to auth.ycceo.com; ③ app_key is correct and not disabled; ④ browser console errors (F12). If it still fails, send the error screenshot to Support.Why do some login methods not use app_secret?
app_key (public identifier) to log in; the key app_secret (signing secret) is hosted server-side by the qrcode service. Mode A signs via the hosted key; Mode B requires the key on your own server for verification. Convenient and secure.Dev Reference (API / Signing / Error Codes / Security) Click to expand
Architecture Overview
The system has two layers: the YOS-Pass site (auth.ycceo.com/YOS-Pass/, hosting registration, access-card & key management, code generation, docs) and the qrcode auth service (QR generation, session management, one-click login, JWT issue & verify). Integrators interact via app_key (access card, public) + app_secret (key, server only).
Integration Modes
- Mode A · Front-end one-click login: the front end only sends
app_keytohttps://auth.ycceo.com/qrcode/yoslogin.php; the service signs with the hosted key and returns the QR. The front end shows the QR, pollshttps://auth.ycceo.com/YOS-Pass/api/session_status.phpevery 2 s, and redirects withaccess_tokenon success. - Mode B · PHP server-side: the server signs the request body with HMAC-SHA256 (
app_key + app_secret), callshttps://auth.ycceo.com/YOS-Pass/api/start_login.phpwith theX-Request-Signatureheader; the front end polls; the server verifies the JWT (exp enforced).
QR generation & one-click login endpoints
Renders a QR image and returns a PNG stream. The content is built server-side from app_key + session params; the 7-day expiry is controlled by QR_EXPIRY_DAYS.
One-click login entry (Mode A): the front end submits app_key and callback params; the server signs with the hosted key, creates a session and returns the QR content / session ID (qr_url + session_id). The front end must NOT carry app_secret.
Mode B: the server signs with HMAC-SHA256 (app_key + app_secret) and calls with the X-Request-Signature header, creating a session and returning the QR content / session ID.
Query session status: pending (waiting) / success (authorized, returns access_token) / expired. The front end polls every 2 seconds.
Signing & verification spec
- The string to sign is the raw JSON body in UTF-8.
- The HMAC-SHA256 key is your
app_secret. - Base64 the signature and put it in the
X-Request-Signatureheader. - JWT verification: split
header.payload.signaturewith standard base64; signing input isheaderB64.payloadB64(one dot); the key is yourapp_secret; enforceexp— missing or expired is rejected.
JWT structure
header.payload.signature
// header
{"alg":"HS256","typ":"JWT"}
// payload — key fields
// exp expiry timestamp (seconds, must be verified)
// iat issued-at timestamp
// app_key access card identifier
// uid / openid / user_info user identity (written on success)
// signature = HMAC_SHA256( base64(header)+"."+base64(payload), app_secret )
Error code table (20 codes)
| Code | Meaning | Troubleshooting |
|---|---|---|
| 0 | Success | Nothing to do |
| 10001 | Missing parameters | Check that required params are present |
| 10002 | Invalid parameter format | Check param types/length against the docs |
| 10003 | app_key not found or disabled | Check the access card is registered/enabled |
| 10004 | Signature verification failed | Check HMAC-SHA256 key and signing input format |
| 10005 | Request expired / timestamp drift | Sync server time, narrow the replay window |
| 10006 | Session not found | Invalid session_id — restart login |
| 10007 | Session expired | Refresh the QR code and restart |
| 10008 | Session state error | Contact admin to check server logs |
| 10009 | QR generation failed | Check the QR render library and params |
| 10010 | Invalid access_token | Restart the login flow |
| 10011 | access_token expired | Enforce exp; re-login when expired |
| 10012 | access_token signature error | Verify the key and the signing-input concatenation |
| 10013 | access_token missing exp | Always enforce exp — reject if missing |
| 10014 | Rate limit exceeded | Slow down polling and retry later |
| 10015 | Server internal error | Check server logs, contact admin |
| 10016 | Request blocked (security) | Check UA/source/rate that may trigger risk control |
| 10017 | Session status API unavailable | Retry later / check network |
| 10018 | QR library failed to load | Check qrcode.min.js path and loading |
| 10019 | Unknown error | Collect context and contact admin |
Security recommendations (must read)
app_secretmust only exist on the server — never in front-end pages, source, apps or logs.- Verify with a standard
verifyYosToken()and enforceexp— reject tokens without exp to prevent "eternal tokens". - Use HTTPS for all endpoints; keep
CURLOPT_SSL_VERIFYPEER = true. - Keep second QR authorization for sensitive ops (delete logs, regenerate app_secret, delete integrator, delete sensitive config): call external
https://auth.ycceo.com/qrcode/api.php, scanned by the YOS IOA App — never self-sign a JWT to bypass it. - Follow the zero browser storage constraint on integration pages: no localStorage / sessionStorage / cookie for sensitive data; export via one-time Blob URLs.
- Rotate app_secret regularly; if leaked, regenerate it via hosting registration and retire the old key.
Technical Support
Any questions? Feel free to contact us
