1. Home
  2. Docs
  3. Developer Guide
  4. API
  5. Autologin (User Session)

Autologin (User Session)

The user_session function creates a one-time login link to a customer’s user panel. Billing systems use it for a “Login to control panel” button, so customers do not need to type their panel password.

URL: https://YOUR-SERVER:2304/v1/user_session/ — permission Autologin.

ParameterRequiredDescription
actionyeslist
useryesHosting account username
timernoHow long the link stays valid, in hours (default 15)
modulenoOpen a specific panel page after login, for example email_accounts or file_manager
curl -k -X POST https://203.0.113.10:2304/v1/user_session/ -d "key=YOUR_API_KEY&action=list&user=john&timer=1"
{"status":"OK","msj":{"accounts":1,"details":[{"user":"john",
 "token":"64c1224f80e6e1f31b6ec863077ffe56.a4be9fef42c1815f1750b464f5bfdb36.0cf2bc06d3d628eab3dbdf10cf5def38.1792963099",
 "url":"https://server.example.com:2083/john/?user_session=64c1224f80e6e1f31b6ec863077ffe56.a4be9fef42c1815f1750b464f5bfdb36.0cf2bc06d3d628eab3dbdf10cf5def38.1792963099"}]}}

Redirect the customer’s browser to msj.details[0].url. The link uses the server hostname and the user panel port 2083.

Warning: The URL logs the customer in without a password. Create it only right before you redirect the customer, use a short timer, and never send it by email or store it.

Related

Was this article helpful to you? No Yes