PHP code example of incvisio / sso

1. Go to this page and download the library: Download incvisio/sso library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

incvisio / sso example snippets


class SSOServer extends Incvisio\SSO\Server
{
    /**
     * Authenticate using user credentials
     *
     * @param string $username
     * @param string $password
     * @return \Incvisio\Validation
     */
    abstract protected function authenticate($username, $password)
    {
        ...
    }

    /**
     * Get the secret key and other info of a service
     *
     * @param string $serviceId
     * @return array
     */
    abstract protected function getServiceInfo($serviceId)
    {
        ...
    }

    /**
     * Get the information about a user
     *
     * @param string $username
     * @return array|object
     */
    abstract protected function getUserInfo($username)
    {
        ...
    }
}

$service = new Incvisio\SSO\Service($serverUrl, $serviceId, $serviceSecret);
$service->attach();

$user = $service->getUserInfo();
echo json_encode($user);