跳至正文
Wener Notes

Auth API

约 1 分钟阅读
标签:API

strapi

  • Login /api/auth/local
  • /connect/github/redirect
  • /api/connect/${provider}
  • /api/auth/${provider}/callback
  • /api/auth/forgot-password
  • /api/auth/reset-password
  • /api/auth/send-email-confirmation
  • /api/auth/email-confirmation?confirmation=TOKEN
text
POST /api/auth/local/register
json
{
  "username": "Strapi user",
  "email": "[email protected]",
  "password": "strapiPassword"
}

修改密码

text
POST /api/auth/change-password
json
{
  "currentPassword": "currentPassword",
  "password": "userNewPassword",
  "passwordConfirmation": "userNewPassword"
}

directus

access token

  • by header
  • by cookie
  • by query
text
Authorization: Bearer <token>
Cookie: directus_session_token=<token>
text
?access_token=<token>

login

text
POST /auth/login
POST /auth/login/provider
json
{
  "email": "[email protected]",
  "password": "password",
  "otp": "123456",
  "mode": "jsoncookie|session"
}
json
{
  "access_token": "",
  "expires": 7200,
  "refresh_token": ""
}

refresh

text
POST /auth/refresh
json
{
  "refresh_token": "refresh_token_string",
  "mode": "json|cookie|session"
}
json
{
  "access_token": "",
  "expires": 7200,
  "refresh_token": ""
}

logout

text
POST /auth/logout
json
{
  "refresh_token": "refresh_token",
  "mode": "json"
}

password reset

text
POST /auth/password/request
json
{
  "email": "user_email",
  "reset_url": ""
}
text
POST /auth/password/reset
json
{
  "token": "password_reset_token",
  "password": "password"
}

providers

text
GET /auth
json
{
  "data": [
    {
      "name": "GitHub",
      "driver": "oauth2",
      "icon": "github"
    },
    {
      "name": "Google",
      "driver": "openid",
      "icon": "google"
    },
    {
      "name": "Okta",
      "driver": "openid"
    }
  ],
  "disableDefault": false
}

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

GitHub2 条
其他外链2 条
最近更新commit f5e9e23编辑