PHP code example of con-troll / auth-openid-connect

1. Go to this page and download the library: Download con-troll/auth-openid-connect 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/ */

    

con-troll / auth-openid-connect example snippets


$oidc = new OpenIDConnectClient('https://id.provider.com/',
                                'ClientIDHere',
                                'ClientSecretHere');

$url = $oidc->getAuthorizationURL();
// send the client to complete the login
// ...
// capture the authentication token from the callback into $code
$oidc->complete($code);
$name = $oidc->requestUserInfo('given_name');