Authentication

Authentication

PrintBase 支持两种鉴权:

  • User JWT:用于 Console/Web 登录态
  • API Key(pb_live_*):用于后端系统调用

User JWT 接口

  • POST /v1/auth/register
  • POST /v1/auth/login
  • GET /v1/auth/me
  • POST /v1/auth/email/verification/send
  • POST /v1/auth/email/verification/confirm

新注册用户会返回 email_verified: false。使用 User JWT 请求发送验证邮件,然后把邮件链接里的 token 提交到确认接口完成邮箱验证。

请求头

Authorization: Bearer <TOKEN_OR_API_KEY>

Scope 权限

常用 scopes:

  • api_keys:read
  • api_keys:write
  • printers:read
  • computers:read
  • print:read
  • print:create