Manage2 Authentication Methods
Last modified: March 9, 2021
The Manage2 API supports HTTP or key-based authentication. Manage2’s client libraries use basic authentication over SSL by default. This method encodes the Manage2 username and password inside the HTTP request headers.
The Manage2 API supports the following authentication methods:
Basic authentication encodes the Manage2 username and password inside the HTTP request headers. You can authenticate with the following methods:
When you call a Manage2 API script in a web browser, a dialog box will appear below the URL:
Enter the Manage2 username and password in the appropriate text boxes.
curl -u command to authenticate user accounts when you call the function via the command line. For example:
curl -u firstname.lastname@example.org:123456luggage https://manage2.cpanel.net/XMLgroupInfo.cgi
cPanelLicensing Perl module to authenticate to the user account. For example:
require PHP class with the
cPanelLicensing PHP Class to authenticate to the user account. For example:
Key-based authentication grants access to a limited subset of the account’s abilities without the account’s username and password. For security, the system limits keys to one IP address. You must register keys on the computer that runs the scripts.
Register a key
To register a key, perform the following steps:
- Use the Manage2 API Add a Pickup Phrase function to add a pickup passphrase.
- Call the Manage2 API Register Key-Based Authentication function. This function returns a 20 character key to use for subsequent API calls.
On subsequent API calls, pass this key as the
apikey parameter’s value. For example:
If you use key-based authentication, the Manage2 API provides a Cross-Origin Resource Sharing (CORS) header.