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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Authentication to 3rd party plugins through scripting

Discussion in 'cPanel Developers' started by Syneic, Aug 18, 2017.

  1. Syneic

    Syneic Member

    Joined:
    Mar 17, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    I've made a plugin which we need access to through an external system, today we use php for this and send an request containing access hash to authenticate.
    After version 64 this type of authentication is deprecated, so I tried to use the new api token system instead but i get the following error:

    X-Error-Message: Token authentication is restricted to WHMAPI calls only

    Is there a way to use token for running 3rd party plugin scripts, or do I need to go back to good old fashion http-header authentication with password ?

    Having a way to run this without using authentication that gives access to whole system would be nice, so if I can put a symlink to my script within available directory for whmapi, that would be an acceptable compromise for me.

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    API tokens are only usable with the following features at this time:

    WHM API functions
    DNS Clusters
    Configuration Clusters

    It's likely your plugin is using cPanel API 2 or UAPI functions, leading to the error message you noticed. The following document lists the additional API authentication options available to you:

    Guide to API Authentication - Software Development Kit - cPanel Documentation

    Thank you.
     
  3. Syneic

    Syneic Member

    Joined:
    Mar 17, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,512
    Likes Received:
    32
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Hi,

    We are working at adding custom end points, like your pluginscript.cgi example, to API Tokens. The work might make it into version 68.
     
  5. Syneic

    Syneic Member

    Joined:
    Mar 17, 2014
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Cool, thanks. ;)
     
Loading...

Share This Page