buy
Single Sign On

Description

Use the SSO (Single Sign On) API to generate the URL to access Webuzo Admin / Enduser Panel.

The API response will contain "URL"  on successful execution of API

Admin SSO

Parameters

Sample Code

curl -ku "user:password" "https://hostname_or_server_IP:2005/index.php?api=json&act=sso&noip=1"
<?php
$user = 'username'; // root or reseller
$pass = 'password';
$host = 'ServerIP / Hostname';

$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@'.$host.':2005/index.php?api=json&act=sso'; 

$post = array('noip' => 1);

// Set the curl parameters 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}

// Get response from the server. 
$resp = curl_exec($ch);
if(!empty(curl_error($ch))){
	echo curl_error($ch); die();
}

// The response will hold a string as per the API response method. 
$res = json_decode($resp, true);

echo "<pre>";
print_r($res['done']['url']);
echo "</pre>";

Output

https://hostname.com:2005/sessiwdshHkjh787kj/?as=iwdsZzj8yy63uPafggfadgagfRG76Z8Yc

User SSO with Admin Credentials

This is useful if you would like to create enduser login link as an Admin

Parameters

Sample Code

curl -ku "user:password" "https://hostname_or_server_IP:2003/?&loginAs=USERNAME&api=json&act=sso&noip=1"
<?php
$user = 'root'; 
$pass = 'password';
$host = 'ServerIP / Hostname';
$loginAs = 'USERNAME'; // User to generate SSO

$url = 'https://'.rawurlencode($user).':'.rawurlencode($pass).'@'.$host.':2003/?&loginAs='.$loginAs.'&api=json&act=sso'; 

$post = array('noip' => 1);

// Set the curl parameters 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

if(!empty($post)){
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
}

// Get response from the server. 
$resp = curl_exec($ch);
if(!empty(curl_error($ch))){
	echo curl_error($ch); die();
}

// The response will hold a string as per the API response method. 
$res = json_decode($resp, true);

echo "<pre>";
print_r($res['done']['url']);
echo "</pre>";

Output

https://hostname.com:2003/sessiwdshHkjh787kj/?as=iwdsZzj8yy63uPafggfadgagfRG76Z8Yc
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list