Cpanel user token access denied
Hello,
trying the example from here
https://docs.cpanel.net/knowledge-base/security/how-to-use-cpanel-api-tokens/
curl -H'Authorization: cpanel username:U7HMR63FHY282DQZ4H5BIH16JLYSO01M' 'https://example.com:2083/execute/Email/add_pop?email=newuser&password=12345luggage'
but alwasy getting 'Access denied'.
The username and Token is correclty set.
Where can be the problem?
-
Hey there! I confirmed the example on that page works well after creating a token in cPanel. Do you see any additional details about that work inside the /usr/local/cpanel/logs/api_log log file?
0 -
In the log I have:
info [cpaneld] Host: ['XXXX'] HTTP Status: ['403'], User: ['CPANEL_USER'], Token Name: [''], Request: ['POST /execute/Email/add_pop?email=newuser&password=__HIDDEN__ HTTP/1.1']
info [cpaneld] Host: ['XXXX'] HTTP Status: ['403'], User: ['CPANEL_USER'], Token Name: [''], Request: ['GET /execute/Email/add_pop?email=newuser&password=__HIDDEN__ HTTP/1.1']0 -
That certainly looks normal - you may need to submit a ticket on this issue so we can do some more advanced troubleshooting directly on the account.
0 -
The problem was that I've created token in different account and didn't spot that..😵.
Is there a way to limit the privileges?
0 -
With the UAPI token there isn't a way to limit the privileges - since it is created in cPanel it can be used for anything in the cPanel account.
0
Please sign in to leave a comment.
Comments
5 comments