PHP code example of futureed / oauth2

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

    

futureed / oauth2 example snippets



Route::group(['middleware' => ['web']],
  Route::get('/oauth/futureed', [
    'as' => 'redirectToFutureED',
    'uses' => 'Auth\AuthController@redirectToFutureED'
  ]);
  Route::get('/oauth/callback', 'Auth\AuthController@callback');
);


namespace App\Http\Controllers;
use FutureED;
use Illuminate\Http\Request;

class AuthController extends Controller
{
  /**
   * Redirecciona al usuario a la pagina de autenticación de FutureED.
   *
   * @return Response
   */
  public function redirectToFutureED()
  {
    return FutureED::driver('FutureED')->redirect();
  }

  /**
   * Obtiene la informacion del usuario de FutureED.
   *
   * @return Response
   */
  public function callback(Request $request)
  {
    $user = FutureED::driver('FutureED')->user($request);
    // $user->token;
  }
}

'providers' => [
  // Proveedores de servicios instalados
  FutureED\OAuth2\FutureEDServiceProvider::class,
],
config/services.php