跳转到内容

auth

此内容尚不支持你的语言。

  • 密码
  • 一次性验证码 (OTP, One-Time Password), (短信, 邮件, 应用)
  • 魔法链接(Magic Link)
POST /api/auth/login
POST /api/auth/register
POST /api/auth/access_token

user

field nametypekeydescription
idstringPKUnique identifier for each user
namestringUser’s chosen display name
emailstringUser’s email address for communication and login
emailVerifiedboolean是否已验证邮箱
imagestring?User’s image url

session

field nametypekeydescription
idstringPKUnique identifier for each session
userIdstringFKUser’s id
tokenstringunique session token
expiresAtDateThe time when the session expires
ipAddressstring?IP address of the device
userAgentstring?User agent of the device

account

field nametypekeydescription
idstringPKUnique identifier for each account
userIdstringFKUser’s id
accountIdstring提供者 的 user.id
providerIdstring提供者 来源, 如 credential, google, github
accessTokenstring?提供者 返回 的 access token
refreshTokenstring?提供者 返回 的 refresh token
accessTokenExpiresAtDate?The time when the access token expires
refreshTokenExpiresAtDate?The time when the refresh token expires
scopestring?提供者返回的 scope
idTokenstring?提供者返回的 id token
passwordstring?Mainly used for email and password authentication

verification

field nametypekeydescription
idstringPKUnique identifier for each verification
identifierstring用于验证请求的标识符, 如 email, phone number
valuestring用于验证的值, 如 短信验证码
expiresAtDate过期时间
  • OAuth 2.1 是对 OAuth 2.0 的改进,简化了规范,移除了不安全的功能(如隐式授权)
  • 更加注重安全性,推荐使用授权码模式(Authorization Code Flow)并结合 PKCE(Proof Key for Code Exchange)
  • 基于 OAuth 2.0 的身份层协议,提供用户身份验证功能。
  • 广泛用于单点登录(SSO)和用户信息共享。
  • 使用设备的公钥加密(如 FIDO2/WebAuthn)进行认证。
  • 用户只需通过设备(如手机或硬件密钥)完成登录,无需记住密码
t1