Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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

Discussion in 'cPanel Developers' started by abhishekkuamr, Jun 8, 2018.

  1. abhishekkuamr

    abhishekkuamr Registered

    Joined:
    Mar 4, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,345
    Likes Received:
    1,854
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. abhishekkuamr

    abhishekkuamr Registered

    Joined:
    Mar 4, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,345
    Likes Received:
    1,854
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. abhishekkuamr

    abhishekkuamr Registered

    Joined:
    Mar 4, 2018
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,345
    Likes Received:
    1,854
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice