/
Create User 2FA
ЕСОЗ - публічна документація
Create User 2FA
Specification
Apiary | |
POST | mithril/users/{user_id}/authentication_factors |
Scope | authentication_factor:write |
Purpose
Create new 2FA item for user.
Request parameters
- user_id
- type
Logic WS
- Validate $.token
- Get user by user_id
- Validate user id & user status
- Validate user `is_blocked` flag
- if is_blocked = TRUE
- return 4xx - "User blocked" (!!! TBD)
Validate existing 2FA item with $.type user
SELECT * FROM authentication_factors AS 2FA WHERE 2FA.user_id = $.user_id AND 2FA.type = $.type
- If not exist 2FA item with $.type
- Insert new record in `authentication_factors` with logical status = RESET
- user_id = $.user_id
- type = $.type
- factor = NULL
- is_active = TRUE
- inserted_at = now()
- update_at = now()
- Return 201
- Insert new record in `authentication_factors` with logical status = RESET
- If exist 2FA with $.type - return 409 error "authentication_factor with such type are exist"
- If not exist 2FA item with $.type
Response
- 201 if 2FA item created successful
- 4xx in other case
, multiple selections available,
Related content
2FA Data model
2FA Data model
More like this
2-Factor Authentication
2-Factor Authentication
Read with this
Enable User 2FA
Enable User 2FA
More like this
Disable User 2FA
Disable User 2FA
More like this
Create User
Create User
More like this
Get user 2FA List
Get user 2FA List
More like this
ЕСОЗ - публічна документація