Authentication Endpoints¶
Login, token management, and session handling.
Overview¶
| Method | Endpoint | Description |
|---|---|---|
| POST | /login/access-token |
Get access token |
| POST | /login/test-token |
Verify token validity |
| POST | /password-recovery/{email} |
Request password reset |
| POST | /reset-password/ |
Reset password with token |
API Reference¶
Sartiq Backend Server - Authentication 0.1.0¶
login¶
POST /api/v1/login/access-token¶
Login Access Token
Description
OAuth2 compatible token login, get an access token for future requests
Request body
{
"grant_type": null,
"username": "string",
"password": "************",
"scope": "string",
"client_id": null,
"client_secret": null
}
Schema of the request body
{
"properties": {
"grant_type": {
"anyOf": [
{
"type": "string",
"pattern": "^password$"
},
{
"type": "null"
}
],
"title": "Grant Type"
},
"username": {
"type": "string",
"title": "Username"
},
"password": {
"type": "string",
"format": "password",
"title": "Password"
},
"scope": {
"type": "string",
"title": "Scope",
"default": ""
},
"client_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Client Id"
},
"client_secret": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"format": "password",
"title": "Client Secret"
}
},
"type": "object",
"required": [
"username",
"password"
],
"title": "Body_login_access_token"
}
Responses
POST /api/v1/login/test-token¶
Test Token
Description
Test access token
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
{
"id": "b745cb49-e19a-401b-bb4e-9c27a7883eed",
"created_at": "2022-04-13T15:42:05.901Z",
"updated_at": "2022-04-13T15:42:05.901Z",
"email": "derp@meme.org",
"full_name": null,
"is_active": true,
"is_superuser": true,
"rework_available": 0
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"email": {
"type": "string",
"format": "email",
"title": "Email"
},
"full_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Full Name"
},
"is_active": {
"type": "boolean",
"title": "Is Active"
},
"is_superuser": {
"type": "boolean",
"title": "Is Superuser",
"default": false
},
"rework_available": {
"type": "integer",
"title": "Rework Available"
}
},
"type": "object",
"required": [
"id",
"email",
"full_name",
"is_active",
"rework_available"
],
"title": "UserPublic"
}
POST /api/v1/password-recovery/{email}¶
Recover Password
Description
Password Recovery
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
email |
path | string | No |
Responses
POST /api/v1/reset-password/¶
Reset Password
Description
Reset password
Request body
Responses
POST /api/v1/password-recovery-html-content/{email}¶
Recover Password Html Content
Description
HTML Content for Password Recovery
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
email |
path | string | No |
Responses
POST /api/v1/login/impersonate¶
Impersonate User
Description
Admin-only: mint a token that authenticates as the target user.
The token includes an optional impersonator_sub claim with the admin's id.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Request body
Schema of the request body
Responses
GET /api/v1/login/impersonation-info¶
Impersonation Info
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
Schema of the response body
POST /api/v1/login/stop-impersonation¶
Stop Impersonation
Description
If the current token is an impersonation token, return a fresh token for the impersonator (admin). Otherwise return 400.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Responses
Schemas¶
Body_login_access_token¶
| Name | Type | Description |
|---|---|---|
client_id |
||
client_secret |
||
grant_type |
||
password |
string(password) | |
scope |
string | |
username |
string |
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
ImpersonateRequest¶
| Name | Type | Description |
|---|---|---|
target_email |
||
target_user_id |
ImpersonationInfo¶
| Name | Type | Description |
|---|---|---|
impersonating |
boolean | |
impersonator_id |
Message¶
| Name | Type | Description |
|---|---|---|
message |
string |
NewPassword¶
| Name | Type | Description |
|---|---|---|
new_password |
string | |
token |
string |
Token¶
| Name | Type | Description |
|---|---|---|
access_token |
string | |
token_type |
string |
UserPublic¶
| Name | Type | Description |
|---|---|---|
created_at |
string(date-time) | |
email |
string(email) | |
full_name |
||
id |
string(uuid) | |
is_active |
boolean | |
is_superuser |
boolean | |
rework_available |
integer | |
updated_at |
string(date-time) |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |