PHP code example of remotemethod / socialite-teamviewer

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

    

remotemethod / socialite-teamviewer example snippets


    'providers' => [
        // Other service providers...

        RemoteMethod\Socialite\TeamViewer\TeamViewerProvider::class,
    ],

    'teamviewer' => [
        'client_id' => 'your-teamviewer-app-id',
        'client_secret' => 'your-teamviewer-app-secret',
        'redirect' => 'http://your-callback-url',
    ],

    

    namespace App\Http\Controllers;

    use Socialite;

    class AuthController extends Controller
    {
        /**
         * Redirect the user to the TeamViewer authentication page.
         *
         * @return Response
         */
        public function redirectToProvider()
        {
            return Socialite::driver('teamviewer')->redirect();
        }

        /**
         * Obtain the user information from TeamViewer.
         *
         * @return Response
         */
        public function handleProviderCallback()
        {
            $user = Socialite::driver('teamviewer')->user();

            // $user->token;
        }
    }