WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_disable_policy
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_disable_policy
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_disable_policy{ "metadata": { "command": "twofactorauth_disable_policy", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_enable_policy
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_enable_policy
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_enable_policy{ "metadata": { "command": "twofactorauth_enable_policy", "reason": "OK", "result": 1, "version": 1 } }
Request
This function generates a random secret and a one-time password authentication (OTP auth) URL for the user. Use the secret that this function returns and a valid verification token with WHM API 1's twofactorauth_set_tfa_config function to configure Two-Factor Authentication (2FA) on an account.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_generate_tfa_config
- A server running WHM.
https://whm-server.tld:2087/json-api/twofactorauth_generate_tfa_config
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/twofactorauth_generate_tfa_config{ "data": { "otpauth_str": "otpauth://totp/Example:root?secret=CAOXW75HKYJJ6E5Y&issuer=Example", "secret": "WJ73QJSKZBXCFIPZ" }, "metadata": { "command": "twofactorauth_generate_tfa_config", "reason": "OK", "result": 1, "version": 1 } }