YOS-Pass logo YOS-Pass Identity Platform
QR Authentication · One-minute Integration

YOS-Pass Unified Identity Authentication

Fill in one form and get production-ready integration code

QR Login Server-side Verification Key Isolation Mobile Friendly Zero Browser Storage
QR code generation service: 2 CNY / request
Official Site auth.ycceo.com/YOS-Pass/
One-line notice: After receiving 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.
01 FLOW

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.

01 1. Scan User scans the QR code on the page with the YOS IOA App
02 2. Confirm The App shows an authorization page and the user taps Confirm
03 3. Verify On success the server receives access_token, verifies signature and exp
04 4. Logged in The page redirects automatically and the user enters your site
02 BUILD

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.

Choose an integration mode
Important: 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).
Before you generate: First register an access card to get your app_key (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.
Sample credentials (read-only):
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.
Stable link for AI: Give the full doc to an AI directly and it may cache an old URL. This link is a stable entry — the AI always fetches the latest server-side doc on every visit.
03 DEPLOY

What you need to do

  1. Get the access card: complete hosting registration to obtain your access card app_key (yoshost_ prefix). The key app_secret is hosted server-side — the front end never handles it.
  2. Generate code: fill in the generator above, pick a mode, click "Generate Code".
  3. Deploy it: copy the code or download the file to your server (static directory for the HTML mode, PHP site for the PHP mode).
  4. User scans: the user scans the QR code with the YOS IOA App and taps Confirm.
  5. Done: on success the page redirects and your server verifies the access_token (don't forget the exp check).
04 SPEC

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_key to call https://auth.ycceo.com/qrcode/yoslogin.php. The key app_secret is 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 calls https://auth.ycceo.com/YOS-Pass/api/start_login.php with the X-Request-Signature header; the front end polls https://auth.ycceo.com/YOS-Pass/api/session_status.php; your server verifies access_token with verifyYosToken() (standard base64, signing input headerB64.payloadB64, key = your app_secret, exp enforced).
05 FAQ

FAQ

Why "verify on server + enforce exp"?
Because 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?
Absolutely not. 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?
The QR code expires in 150 seconds by default (controlled by the server). The front end polls every 2 seconds; when expired the UI shows a hint and a "Refresh QR" button — no full page reload needed.
How do I get user info after login?
The 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?
Check in order: ① the page must be served over http/https so 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?
This is the access-card separation design: you only need the access card 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.
06 QUICK

Quick Reference

The most used items, one card away

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_key to https://auth.ycceo.com/qrcode/yoslogin.php; the service signs with the hosted key and returns the QR. The front end shows the QR, polls https://auth.ycceo.com/YOS-Pass/api/session_status.php every 2 s, and redirects with access_token on success.
  • Mode B · PHP server-side: the server signs the request body with HMAC-SHA256 (app_key + app_secret), calls https://auth.ycceo.com/YOS-Pass/api/start_login.php with the X-Request-Signature header; the front end polls; the server verifies the JWT (exp enforced).

QR generation & one-click login endpoints

GET https://auth.ycceo.com/qrcode/api.php

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.

POST https://auth.ycceo.com/qrcode/yoslogin.php

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.

POST https://auth.ycceo.com/YOS-Pass/api/start_login.php

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.

GET https://auth.ycceo.com/YOS-Pass/api/session_status.php?session_id=xxx&app_key=xxx

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-Signature header.
  • JWT verification: split header.payload.signature with standard base64; signing input is headerB64.payloadB64 (one dot); the key is your app_secret; enforce exp — 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)

CodeMeaningTroubleshooting
0SuccessNothing to do
10001Missing parametersCheck that required params are present
10002Invalid parameter formatCheck param types/length against the docs
10003app_key not found or disabledCheck the access card is registered/enabled
10004Signature verification failedCheck HMAC-SHA256 key and signing input format
10005Request expired / timestamp driftSync server time, narrow the replay window
10006Session not foundInvalid session_id — restart login
10007Session expiredRefresh the QR code and restart
10008Session state errorContact admin to check server logs
10009QR generation failedCheck the QR render library and params
10010Invalid access_tokenRestart the login flow
10011access_token expiredEnforce exp; re-login when expired
10012access_token signature errorVerify the key and the signing-input concatenation
10013access_token missing expAlways enforce exp — reject if missing
10014Rate limit exceededSlow down polling and retry later
10015Server internal errorCheck server logs, contact admin
10016Request blocked (security)Check UA/source/rate that may trigger risk control
10017Session status API unavailableRetry later / check network
10018QR library failed to loadCheck qrcode.min.js path and loading
10019Unknown errorCollect context and contact admin

Security recommendations (must read)

  • app_secret must only exist on the server — never in front-end pages, source, apps or logs.
  • Verify with a standard verifyYosToken() and enforce exp — 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.
07 SUPPORT

Technical Support

Any questions? Feel free to contact us