CMD_API_LOGIN_KEYS generates key but CMD_LOGIN still prompts for username/password

lleme

New member
Joined
Aug 11, 2025
Messages
3
Hello,


I am trying to log in to DirectAdmin Evolution panel automatically using the API.


  1. I successfully generate a temporary Login Key via CMD_API_LOGIN_KEYS. The response looks correct and contains the key.
  2. I then try to open the DirectAdmin panel using CMD_LOGIN with the username and the generated key, either via curl or a POST form in the browser.

However, the panel still asks for the username and password instead of logging in automatically.


Here is the data I use to create the key:


php
$postData = [
'action' => 'create',
'type' => 'key',
'keyname' => 'tempkey123',
'key' => 'Tmp1234!Aa@5678',
'key2' => 'Tmp1234!Aa@5678',
'never_expires' => 'no',
'expiry_timestamp' => time() + 300,
'max_uses' => 1,
'clear_key' => 'yes',
'allow_html' => 'yes',
'passwd' => 'admin_password',
'for_user' => 'testuser',
'select_allow0' => 'ALL_USER'
];


The response from CMD_API_LOGIN_KEYS indicates that the key was created successfully.


But when I use:


perl

the Evolution panel still requests a login.


Am I missing a required parameter or step to log in automatically with a Login Key?


Thank you for your help!
 
Hello,

I believe there is no option to create a key for another user. The key can be created only for the user which you connect as. So the parameter for_user is misused here. Only the following parameters can be used:

JSON:
{
  "allowCommands": [],
  "allowLogin": true,
  "allowNetworks": [],
  "autoRemove": true,
  "denyCommands": [],
  "expires": "2025-08-15T17:35:00.000Z",
  "hasExpiry": true,
  "id": "Test",
  "password": "RgNpgeKGdvQ4tsraKxuv",
  "currentPassword": "secret-password"
}

and some other listed on the page: https://docs.directadmin.com/changelog/version-1.59.0.html#example

But it does not have for_user
 
The example how to create login key for normal user using reseller/admin is in this thread.
 
Back
Top