Generate an Authenticator Secret for 2FA
Generate a secret for setting up 2FA with an authenticator app.
Request URL
POST {base_url}/uc-auth/api/v1/mfa/authenticator/setup
Request parameters
- Headers
-
Parameter Required Type Description Authorization Yes String The access token used for authentication. Format: Bearer
{access_token}.
Response parameters
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| code | String | The HTTP status code of the request.
|
| message | String | The status message of the request. |
| detailMessage | String | The detailed error information. When the request is successful, this parameter returns empty. |
| result | Object<Secret_Info> | The authenticator secret information. |
- Secret_Info
-
Parameter Type Description qrUri String The URI used to generate a QR code that can be scanned by an authenticator app. secret String The secret in plain text, which is used for manual entry when the QR code cannot be scanned.
Example
Request example
POST /uc-auth/api/v1/mfa/authenticator/setup HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxMDAwQGNvbG9ydGVzdDIiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJ1c2VyX25hbWUiOiIxMDAwQGNvbG9ydGVzdDIiLCJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiY2xpZW50X2V4dCI6eyJkZXNjcmlwdGlvbiI6IueuoeeQhuWQjuWPsFdlYuW6lOeUqCIsInBsYXRmb3JtIjoid2ViIn0sImV4cCI6MTc5MTg4NDU5MywiaWF0IjoxNzkxODYyOTkzLCJqdGkiOiJhODhkMzhiMC05ZTcwLTQ0M2ItOTdjMy0xZGJhMGEwZjhjYTkiLCJjbGllbnRfaWQiOiJub3ZvLWFkbWluLXdlYiIsInNpZCI6IjVhMGY1N2M1LWNjNTMtNDM3ZC1hMmVkLWYzYWVlNmIxNDlkYyIsInVzZXJfZXh0Ijp7InJvbGVJZHMiOlsxMDJdLCJwdWlkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJ0ZW5hbnRJZCI6MjA3OTUwNDIwNTMwOTE5NDI0MSwicGFyZW50VWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5NiwidGVuYW50Q29kZSI6ImNvbG9ydGVzdDIiLCJ0eXBlIjoiVF9VU0VSIiwidXNlcklkIjoyMDc5NzQ2OTE1Mzg4MDc2MDMzLCJlbWFpbCI6Imxlb0BzYW1wbGUuY29tIiwidXNlcm5hbWUiOiIxMDAwQGNvbG9ydGVzdDIiLCJ1Y0lkIjozMDc2OTEzNjQ0ODkwODMyODk2fX0.anYLyRPR_oKHpMvBGeoEfhuSyLWvlxAFKJgXnXXR27AzfEYFqDPA_LwWdmRKSfj0KoczJWQO9W8AGk4VWCB5uC7oEPqTXXV9Kz9m54rhZPooPueplR9rCIWRtYZMiiotZv6FmBVCww46zv--wgHZ9COLQtlSshr-C4zkGwtGJ0OfTp9XQafqh3BikrzEB0WH5pSNlU6XbLFiUt7ktX_-wnT4KJJxZCbGJqL6T8pl2zDG1sZw43ptvWSuJUa5LGbUDEGjrhR0LI5UWCF7Fq4qf7XYvOTIMxD0D3lmY16EjyzMOPOx7ib2Antz6q1L5Keh2rTBCaMXBLCMGmjbu5gqVA
Response example
HTTP/1.1 200 OK { "result": { "qrUri": "otpauth://totp/novoone.com:1000@jint?secret=OCKZTQJYQVF4EIKW3WPXSB2FIDV3CJYD&issuer=novoone.com&algorithm=SHA1&digits=6&period=30", "secret": "OCKZTQJYQVF4EIKW3WPXSB2FIDV3CJYD" }, "requestId": "7a681f10641cb5b18422215c86e051ef", "code": "200", "message": "SUCCESS" }