URL : /xhr/logout
Method : GET
Authentication required : YES
Example
GET /xhr/logout
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/session
Method : GET
Authentication required : YES
Example
GET /xhr/session
Response Code : 200
{
"user": {
"username": "admin",
"superAdmin": true
},
"session": {
"maxAge": 6729273,
"totp": false
}
}
Response Code :
401 Unauthorized
500 Internal Server Error
Returns a secret that should be used when setting up Google Authenticator.
URL : /xhr/session/totp/generate
Method : GET
Authentication required : YES
Example
GET /xhr/session/totp/generate
Response Code : 200
{
"secret": "OR5GG3..."
}
Response Code :
401 Unauthorized
500 Internal Server Error
Activate Google authentication for current user, can only be applied to database users.
URL : /xhr/session/totp
Method : POST
Authentication required : YES
Body parameters
- secret: string (Secret key generated from GET /xhr/session/totp/generate)
- token: string (A token from Google authenticator)
Example
POST /xhr/session/totp
{
"secret": "OR5GG3...",
"token": "123456"
}
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/session/totp
Method : DELETE
Authentication required : YES
Body parameters
- token: string (A token from Google Authenticator)
Example
DELETE /xhr/session/totp
{
"token": "123456"
}
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error