Manage2 API Function - Register Key-Based Authentication


Last modified: March 16, 2021

Description

This function registers a server to use keyed authentication.

Examples

XML

https://manage2.cpanel.net/XMLregisterAuth.cgi?user=username%40example.com&pickup=this+is+an+example+pickup+phrase%3F&service=license-suite-2000

JSON

https://manage2.cpanel.net/XMLregisterAuth.cgi?output=JSON&user=username%40example.com&pickup=this+is+an+example+pickup+phrase%3F&service=license-suite-2000

YAML

https://manage2.cpanel.net/XMLregisterAuth.cgi?output=yaml&user=username%40example.com&pickup=this+is+an+example+pickup+phrase%3F&service=license-suite-2000

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php
    include("cpl.inc.php");
    $cpl = new cPanelLicensing();
    $cpl->registerAuth(array(
        "user" => "[email protected]",
        "pickup" => "this is an example pickup phrase",
        "service" => "license-suite-2000",
        )
    );
 ?>

1
2
3
4
5
6
7
use cPanelLicensing;
my $cpl = cPanelLicensing->new();
$cpl->registerAuth(
    'user'    => 'username\@example.com',
    'pickup'  => 'this is an example pickup phrase',
    'service' => 'license-suite-2000',
);

<XMLRegisterAuth key="ab1de2gh3jk4mn5pq6st" ip="192.0.2.0" reason="Successfully registered license-suite-2000 on 192.0.2.0" status="1" />

1
2
3
4
5
6
{
    "status": 1,
    "reason": "Successfully registered license-suite-2000 on 192.0.2.0",
    "key": "ab1de2gh3jk4mn5pq6st",
    "ip": "192.0.2.0"
}

1
2
3
4
5
---
status: 1
reason: Successfully registered license-suite-2000 on 192.0.2.0
key: ab1de2gh3jk4mn5pq6st
ip: 192.0.2.0

Parameters

This function accepts the following parameters:

Parameter Type Description Example
user string Required
The account’s username.
[email protected]
pickup string Required
The pickup phrase to add.
this is an example pickup phrase
service string Required
The name of the service that uses the authentication scripts.
license-suite-2000

Returns

This function returns the following values:

Return Type Description Example
key string A key to authenticate the IP address. ab1de2gh3jk4mn5pq6st
ip string The account’s IP address. 192.0.2.0
reason string A message about the IP address authentication. Successfully registered license-suite-2000 on 192.0.2.0
status Boolean Whether the function succeeded:
  • 1 — Success.
  • 0 — Failure.
1

Additional Documentation