PHP code example of xdrew / oauth2-odnoklassniki

1. Go to this page and download the library: Download xdrew/oauth2-odnoklassniki 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/ */

    

xdrew / oauth2-odnoklassniki example snippets


$provider = new xdrew\OAuth2\Client\Provider\Odnoklassniki([
    'clientId'     => '1234567',
    'clientPublic' => 'CBAPKGGLEBACACACA',
    'clientSecret' => 's0meRe4lLySEcRetC0De',
    'redirectUri'  => 'https://example.org/oauth-endpoint',
    'scopes'       => ['GET_EMAIL'], // OPTIONAL You should request access to this scope from ok.ru support to get user email
    'userFields'   => [''], // OPTIONAL 
]);