Package Data | |
---|---|
Maintainer Username: | remotemethod |
Maintainer Contact: | remotemethod@yahoo.com (Eugene Gavalidi) |
Package Create Date: | 2016-04-03 |
Package Last Update: | 2016-04-03 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-22 15:00:56 |
Package Statistics | |
---|---|
Total Downloads: | 8 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel Socialite provides an expressive, fluent interface to OAuth authentication with TeamViewer. It handles almost all of the boilerplate social authentication code you are dreading writing.
Laravel Socialite TeamViewer is open-sourced software licensed under the MIT license
In addition to typical, form based authentication, Laravel also provides a simple, convenient way to authenticate with OAuth providers using Laravel Socialite. Socialite currently supports authentication with Facebook, Twitter, LinkedIn, Google, GitHub and Bitbucket.
To get started with Socialite TeamViewer, add to your composer.json
file as a dependency:
composer require remotemethod/socialite-teamviewer
After installing the Socialite library, register the RemoteMethod\Socialite\TeamViewer\TeamViewerProvider
in your config/app.php
configuration file:
'providers' => [
// Other service providers...
RemoteMethod\Socialite\TeamViewer\TeamViewerProvider::class,
],
You will also need to add credentials for the OAuth services your application utilizes. These credentials should be placed in your config/services.php
configuration file, and should use the key teamviewer
depending on the providers your application requires. For example:
'teamviewer' => [
'client_id' => 'your-teamviewer-app-id',
'client_secret' => 'your-teamviewer-app-secret',
'redirect' => 'http://your-callback-url',
],
Next, you are ready to authenticate users! You will need two routes: one for redirecting the user to the OAuth provider, and another for receiving the callback from the provider after authentication. We will access Socialite using the Socialite
facade:
<?php
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;
}
}