feat: add username-password login flow via authentik token endpoint

This commit is contained in:
Chris
2026-03-30 00:52:09 +08:00
parent 7ddf66dfdd
commit ad6d16c97e
12 changed files with 139 additions and 17 deletions

View File

@@ -2,6 +2,31 @@
Base URL`https://memberapi.ose.tw`
## 0. 帳號密碼登入
### POST `/auth/login`
Request:
```json
{
"username": "your-authentik-username",
"password": "your-password"
}
```
200 Response:
```json
{
"access_token": "<jwt>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "openid profile email"
}
```
401 Response:
```json
{ "detail": "invalid_username_or_password" }
```
## 1. 使用者資訊
### GET `/me`
Headers: