Page tree
Skip to end of metadata
Go to start of metadata

This function lists the external authentication links to the current cPanel account.


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/ExternalAuthentication/get_authn_links

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Lists the external authentication links to the current account.
$list_external_links = $cpanel->uapi(
    'ExternalAuthentication', 'get_authn_links'
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# lists the external authentication links to the current account.
my $list_external_links = $cpliveapi->uapi(
    'ExternalAuthentication', 'get_authn_links'
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- lists the external authentication links to the current account. -->
[% data = execute( 'ExternalAuthentication', 'get_authn_links' ); %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username ExternalAuthentication get_authn_links

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

   },
   "data":[  
      {  
         "preferred_username":"username@gmail.com",
         "link_time":1443124604,
         "subject_unique_identifier":"123456789012345678901",
         "provider_protocol":"openid_connect",
         "provider_id":"google"
      },
      {  
         "preferred_username":"username@gmail.com",
         "link_time":1443124604,
         "subject_unique_identifier":"123456789012345678901",
         "provider_protocol":"openid_connect",
         "provider_id":"google"
      }
   ]
}

Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

This function does not accept parameters.

ReturnTypeDescriptionPossible ValuesExample

preferred_username

string

The preferred username of the account on the identity provider.

A valid string.username@gmail.com

link_time

integer

When the user linked their account to the identity provider.

A valid integer in Unix time.1443124604

subject_unique_identifier

integer

The unique identifier for the user at the identity provider.

A valid integer.123456789012345678901

provider_protocol

string

The identity provider's protocol.

A valid string.openid_connect

provider_id

string

The system's unique key for the identity provider.

A valid string.google