PHP code example of jansuchanek / noauth

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

    

jansuchanek / noauth example snippets


use NOAuth\OAuthManager;
use NOAuth\OAuthUser;

// Get authorization URL
$result = $manager->getAuthorizationUrl('google');
// redirect to $result['url'], store $result['state']

// Handle callback
$oauthUser = $manager->handleCallback('google', $code);
// $oauthUser->email, ->firstName, ->lastName, ->avatarUrl, ->provider, ->oauthId

// Google One Tap
$oauthUser = $manager->handleGoogleOneTap($credential);