Auth API
- API Keys
- Basic Auth
- OAuth 2.0
- HMAC
- 参考
- simov/grant
- JS
- OAuth Proxy
- simov/purest
- REST API Client Library
- https://docs.strapi.io/dev-docs/plugins/users-permissions
- https://docs.directus.io/reference/authentication.html
- simov/grant
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
POST /api/auth/local/register
{
"username": "Strapi user",
"email": "[email protected]",
"password": "strapiPassword"
}
修改密码
POST /api/auth/change-password
{
"currentPassword": "currentPassword",
"password": "userNewPassword",
"passwordConfirmation": "userNewPassword"
}
directus
access token
- by header
- by cookie
- by query
Authorization: Bearer <token>
Cookie: directus_session_token=<token>
?access_token=<token>
login
POST /auth/login
POST /auth/login/provider
{
"email": "[email protected]",
"password": "password",
"otp": "123456",
"mode": "jsoncookie|session"
}
{
"access_token": "",
"expires": 7200,
"refresh_token": ""
}
refresh
POST /auth/refresh
{
"refresh_token": "refresh_token_string",
"mode": "json|cookie|session"
}
{
"access_token": "",
"expires": 7200,
"refresh_token": ""
}
logout
POST /auth/logout
{
"refresh_token": "refresh_token",
"mode": "json"
}
password reset
POST /auth/password/request
{
"email": "user_email",
"reset_url": ""
}
POST /auth/password/reset
{
"token": "password_reset_token",
"password": "password"
}
providers
GET /auth
{
"data": [
{
"name": "GitHub",
"driver": "oauth2",
"icon": "github"
},
{
"name": "Google",
"driver": "openid",
"icon": "google"
},
{
"name": "Okta",
"driver": "openid"
}
],
"disableDefault": false
}