Login Into Install
POST
/installs/{id}/login
Log into an installed application's administrative backend (aka. "SSO" or "Single Sign-On").
This feature is currently only available for installs of WordPress, Joomla!, ClassicPress, and Modx.
Parameters
API
/installs/{id}/login
API endpoint.
{id} is the internal ID of the install to log into as administrator.
POST
Optional parameters
Optional URL the user will be forwarded to after a successful login. This can be a relative to the application's URL or a full URL.
default is to automatically forward to the application's administrative backend
The Installatron Server user the task is to be performed on or for.
default is the owner of the installation identified by {id} in the API request
Response
Response
HTTP status code describing the result of the request.
200
for
Success.
All other numbers represent errors which are described in the
errcode output below.
true
= Success.
false
= Failure.
status code 403
invalid_api_key
The server's Installatron Server Key is invalid.
invalid_argument_user
User specified is not authorized to access this data.
status code 404
install_not_found
The app ID was not found or it was found by is owned by a user who does not have access to it.
status code 500
failed_website_vhost
User's webhosting account does not manage this domain. That is, the domain is in the account's vhosts list.
failed_filesystem_host
Unable to reach the remote host.
failed_filesystem_login
The SFTP/FTP/SFTP server rejected the login.
failed_filesystem_ondemand
(Only when when enablePath is defined in /usr/local/instalatron/etc/panel.php) The path was invalid.
failed_filesystem_permission
Insufficient user permissions to the path provided.
failed_filesystem_quota
User's Disk Space or Files Usage (inodes) quota was exceeded.
If the cause of an error was an incorrect
field value then this will show the ID of the field.
(eg.
login
,
passwd
,
email
)
Message describing the result of the request. Do not rely on this to determine the success or failure of the request.
URL to the single-sign-on script that was created. Forward the user's browser to this URL to log into the application.
(eg.
https://website.com/blog/deleteme.sso12345.php?12345
)
Full Examples
Example: Login to a WordPress backend and view its administrative page
Method: curl
curl -X POST https://{SERVER_IP}/installs/1234567890abcdefghij12345/login \
-H 'X-API-KEY: {the key= or key2= value from /usr/local/installatron/etc/settings.ini}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"url": "https://www.website.com/wp-admin"
}
'
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a WordPress backend and view its administrative page using a relative URL
Method: curl
curl -X POST https://{SERVER_IP}/installs/1234567890abcdefghij12345/login \
-H 'X-API-KEY: {the key= or key2= value from /usr/local/installatron/etc/settings.ini}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"url": "/wp-admin"
}
'
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a ModX backend and view its administrative page using a different type of relative URL
Method: curl
curl -X POST https://{SERVER_IP}/installs/1234567890abcdefghij12345/login \
-H 'X-API-KEY: {the key= or key2= value from /usr/local/installatron/etc/settings.ini}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"url": "controllers/default/welcome.class.php"
}
'
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Full Examples
Example: Login to a WordPress backend and view its administrative page
Method: json payload to curl
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a WordPress backend and view its administrative page using a relative URL
Method: json payload to curl
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a ModX backend and view its administrative page using a different type of relative URL
Method: json payload to curl
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Full Examples
Example: Login to a WordPress backend and view its administrative page
Method: curl, php, and a user's login
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_URL => "https://{SERVER_IP}/installs/1234567890abcdefghij12345/login",
CURLOPT_HTTPHEADER => [
"X-API-KEY: {the key= or the key2= value from /usr/local/installatron/etc/settings.ini}",
"Accept: application/json",
"Content-Type: application/json"
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode(
[
'url' => 'https://www.website.com/wp-admin'
]
)
]);
if (( $response = curl_exec($ch) )=== false )
{
trigger_error(curl_error($ch));
}
curl_close($ch);
var_export(json_decode($response, true));
?>
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a WordPress backend and view its administrative page using a relative URL
Method: curl, php, and a user's login
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_URL => "https://{SERVER_IP}/installs/1234567890abcdefghij12345/login",
CURLOPT_HTTPHEADER => [
"X-API-KEY: {the key= or the key2= value from /usr/local/installatron/etc/settings.ini}",
"Accept: application/json",
"Content-Type: application/json"
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode(
[
'url' => '/wp-admin'
]
)
]);
if (( $response = curl_exec($ch) )=== false )
{
trigger_error(curl_error($ch));
}
curl_close($ch);
var_export(json_decode($response, true));
?>
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a ModX backend and view its administrative page using a different type of relative URL
Method: curl, php, and a user's login
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_URL => "https://{SERVER_IP}/installs/1234567890abcdefghij12345/login",
CURLOPT_HTTPHEADER => [
"X-API-KEY: {the key= or the key2= value from /usr/local/installatron/etc/settings.ini}",
"Accept: application/json",
"Content-Type: application/json"
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode(
[
'url' => 'controllers/default/welcome.class.php'
]
)
]);
if (( $response = curl_exec($ch) )=== false )
{
trigger_error(curl_error($ch));
}
curl_close($ch);
var_export(json_decode($response, true));
?>
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Full Examples
Example: Login to a WordPress backend and view its administrative page
Method: cli
/usr/local/installatron/installatron \
--POST /installs/1234567890abcdefghij12345/login \
--url https://www.website.com/wp-admin
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a WordPress backend and view its administrative page using a relative URL
Method: cli
/usr/local/installatron/installatron \
--POST /installs/1234567890abcdefghij12345/login \
--url /wp-admin
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a ModX backend and view its administrative page using a different type of relative URL
Method: cli
/usr/local/installatron/installatron \
--POST /installs/1234567890abcdefghij12345/login \
--url controllers/default/welcome.class.php
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Full Examples
Example: Login to a WordPress backend and view its administrative page
Method: json payload from cli
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a WordPress backend and view its administrative page using a relative URL
Method: json payload from cli
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}
Example: Login to a ModX backend and view its administrative page using a different type of relative URL
Method: json payload from cli
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": "https://website.com/blog/deleteme.sso1234567890abcdefghij1234567890ab.php?1234567890abcdefghij1234567890abc"
}