Auto login to 3rd party software from custom cPanel plugin?

abhishekkuamr

Registered
Mar 4, 2018
3
0
1
Bangalore
cPanel Access Level
Website Owner
Hello,

I have a requirement where I have to develop a cpanel plugin/feature which has one external link somewhere. I want, on opening the plugin if the cpanel user clicks that external link, the user should be auto logged in to my external service. That is, in my external service, I need to verify the user (may be just verify if his cp_security_token is correct or not) and then fetch his account details.

I am not able to find any relevant docs. I researched about hooks, API tokens, etc but none of them seems to provide a way to validate a cp_security_token of a cpanel user.

What are different ways to achieve this? Any leads will be really helpful.

Access level: WHM root
Cpanel version: 70.0.46

--
Abhishek
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,912
2,241
363
Hello @abhishekkuamr,

We support the use of a few external authentication methods to access cPanel & WHM services, but we don't support using cPanel login credentials for third-party services. For instance, you could allow your server's users to log in to WHM, cPanel, and Webmail with a Google account using the instructions at:

Guide to External Authentication - Developer Documentation - cPanel Documentation

However, no functionality exists to login to Google using your cPanel & WHM login credentials, which appears to be an example of the functionality you are seeking if I understand correctly.

Thank you.
 

abhishekkuamr

Registered
Mar 4, 2018
3
0
1
Bangalore
cPanel Access Level
Website Owner
Is there any documentation around the flow of the APIs, where is the server, which code layer handles the auth, who manages the issued cp_security_tokens, who invokes the Perl Modules, etc?
This will help me to check if there is any possibility to write any custom perl module which does what I need.
 

abhishekkuamr

Registered
Mar 4, 2018
3
0
1
Bangalore
cPanel Access Level
Website Owner
These API documentations I already went through. What I was looking looking for is internal documentation around the codes. How the code is organized, mostly the backend code, i.e. which code layer handles the auth, who manages the issued cp_security_tokens, who invokes the Perl Modules, etc?
For eg: /usr/local/cpanel/Cpanel/* contains all the perl modules which has cpanel modules/functions defined.
/usr/local/cpanel/base/frontend/* has the frontend files.

But I need to know where is the backend code, the auth layer, the security token handler, how the complete code in organized in cpanel, which folder does what, etc?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,912
2,241
363
Hello @abhishekkuamr,

There's no documentation available for the information you are seeking. cPanel & WHM isn't open source, so not all of the files included as part of the installation are viewable.

That said, if you can provide more information about the specific task you'd like to complete, I can try to guide you towards the best way to accomplish it.

Thank you.