UAPI Functions - Market::validate_login_token

Description

This function validates a login token to a cPanel Market provider and returns an access token.

Examples


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Market/validate_login_token?provider=cPStore&login_token=8765309&url_after_login=http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Validate the login token to the cPanel Market provider.
$validate $cpanel->uapi(
    'Market''validate_login_token',
    array(
        'provider'        => 'cPStore',
        'login_token'     => '8675309',
        'url_after_login' => 'http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate'
 )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Validate the login token to the cPanel Market provider.
my $validate $cpliveapi->uapi(
    'Market''validate_login_token',
    {
        'provider'        => 'cPStore',
        'login_token'     => '8675309',
        'url_after_login'  => 'http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate'
 }
);

 cPanel Template Toolkit

<!-- Validate the login token to the cPanel Market provider. -->
[% execute('Market', 'validate_login_token', { provider => 'cPStore',
login_token => '8675309', url_after_login => 'http%3A%2F%2Fhostname.example.com%2Fredirectionlocation.cgi%3Fstate' } ) %]

 Command Line

uapi --user=username Market validate_login_token provider=cPStore login_token=8675309 url_after_login=http://hostname.example.com/redirectionlocation.cgi?state

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

 

Note:

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

 

Parameters

Parameter

Type

Description

 Possible values 

Example

provider

string

Required

The name of the cPanel Market provider.

A valid string.

cPStore

login_token

string

Required

The login token for the cPanel Market provider.

A valid string.

8675309

 url_after_login 

 string 

Required

 The url_after_loginvalue that you sent to UAPI'sMarket::get_login_urlfunction. 

A valid URL.

 http://hostname.example.com/redirectionlocation.cgi?state 

 

Returns

Note:

This function may return additional information that the system does not currently use.

Return

 Type 

Description

 Possible values 

 Example 

 access_token 

 string 

 The access token that returns from the code parameter after you log in with UAPI's Market::get_login_url function. 

A valid scalar.

8675309

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....