DEV Community

Cover image for Live streaming API auth failures: accessToken, kitToken, and quota
Imou-OpenPlatform
Imou-OpenPlatform

Posted on

Live streaming API auth failures: accessToken, kitToken, and quota

Which API can I use for live camera streaming? For interactive browser monitoring, use getKitToken with ImouPlayer. For HLS live addresses, call bindDeviceLive. For RTMP, call createDeviceRtmpLive. Always obtain accessToken on your server first. Most “auth failures” are not a missing live API—they are the wrong token type, a secret in the browser, an expired kitToken, or live-view quota exhaustion.

Why it matters

Teams often conclude “live streaming is broken” when the OpenAPI call succeeds and the player still shows a black screen. The failure mode is usually credential boundary: accessToken authenticates OpenAPI; kitToken (about 2 hours TTL) authorizes ImouPlayer; HLS/RTMP URLs are a separate path. Quota and service entitlements add another class of errors that look like auth. This FAQ maps symptoms to causes so you fix the right layer.

Product overview: Video Monitoring.

Symptom → cause → fix

Symptom Likely cause Fix
ImouPlayer black screen; OpenAPI calls work accessToken passed to the player instead of kitToken Mint getKitToken on the BFF; initialize ImouPlayer with kitToken only
401 / invalid token on OpenAPI Missing, expired, or client-side accessToken; wrong appId/appSecret Call accessToken from the server only; cache and refresh per platform guidance; never ship appSecret to the browser
Live works briefly (~2h), then fails kitToken TTL (~2 hours) without refresh Cache ~1 hour on BFF; re-mint through your ACL-gated endpoint before expiry on long sessions
Device list empty or “device not found” on live Camera not bound to the developer asset pool (only in a consumer account) Bind devices on open.imoulife.com; confirm inventory via listDeviceDetailsByPage
Live mint succeeds intermittently; concurrent tiles die Live-view / resource quota exceeded Cap concurrent slots; default streamId = 1 (SD); check My Resources; destroy players on close
HLS/RTMP URL works for anyone who has it; “auth” feels missing Live URLs are shareable secrets, not SaaS sessions Issue bindDeviceLive / createDeviceRtmpLive only after your product ACL; treat URLs as sensitive; unbind/recycle when policy requires
Talk / PTZ / playback UI present but inactive Capability depends on device model and subscribed services Gate controls in UI; do not treat missing features as token failure
Multi-tenant user sees wrong camera or cross-tenant stream Shared admin token / unscoped kitToken cache Authorize tenant/site/role before minting; key caches by tenant + device identity

Use this table before rewriting players or inventing a second streaming stack.

Which live path to use (after auth works)

Product surface API / component Notes
Interactive web live (preview, talk, PTZ, playback UI when supported) getKitToken + ImouPlayer Default for in-product dashboards
Standard HLS address bindDeviceLive Custom players, gated share pages
RTMP pipeline createDeviceRtmpLive Media servers / RTMP consumers—not the default browser tile
Inventory before play listDeviceDetailsByPage Confirm the device exists for your app (pageSize 1–50)

Docs: JS SDK, bindDeviceLive, Custom live broadcast. Quality: streamId 0 = HD, 1 = SD.

Recommended recovery steps

  1. Confirm the surface. Is the client ImouPlayer, an HLS player, or an RTMP consumer? Do not mix credentials across paths.
  2. Verify server auth. Your BFF holds appId/appSecret, obtains accessToken, and never returns them to the SPA.
  3. Authorize in your product. Check tenant/site/role for that deviceId/channelId before any live mint.
  4. Mint the matching credential. getKitToken for ImouPlayer; bindDeviceLive for HLS; createDeviceRtmpLive for RTMP.
  5. Check quota and concurrency. Prefer on-demand SD tiles; close players when slots empty; review My Resources when failures cluster at peak hours.
  6. Separate capability issues. If video plays but talk/PTZ/playback is unavailable, treat that as device/service entitlement—not as auth.

APIs and tokens (quick reference)

Name Role Where it lives
appSecret Developer secret Server / secrets manager only
accessToken OpenAPI server auth BFF only
kitToken ImouPlayer play credential (~2h TTL) Returned to browser after ACL
Live HLS/RTMP URL Protocol address Issued only after ACL; treat as secret

Limits and pitfalls

  • kitTokenaccessToken. This is the most common ImouPlayer failure.
  • Never put accessToken or appSecret in the browser. Only short-lived play credentials (or carefully gated live URLs) belong client-side.
  • Quota looks like auth. Exhausted live-view resources can surface as intermittent play failures under load.
  • Capabilities vary. Talk, PTZ, and cloud playback depend on device and subscribed services.
  • No GB28181 path on this international Open Platform video monitoring flow—use the documented OpenAPI/SDK live methods above.

Register at https://open.imoulife.com — Imou Open Platform is cloud video and AIoT focused, with APIs, SDKs, and low-code components to help vendors and developers ship live video features faster. Start from Video Monitoring.

Top comments (0)