Laravel Socialite - Driver [youtube] not supported

Deadly 提交于 2019-12-11 02:06:34

问题


I'm having an issue when trying to use the Socialite Manager driver for YouTube Auth. This is the error I'm faced with:

InvalidArgumentException in Manager.php line 90:
Driver [youtube] not supported.

Here's my controller file:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;

use Socialite;

class SocialAuthController extends Controller
{
   public function redirect($provider)
   {

        return Socialite::with($provider)->redirect();
   }

   public function callback($provider)
   {
        $user = Socialite::driver($provider)->user();
        dd($user);

   }


}

I have successfully tried this with the following default authentications: Facebook, Linkedin and google. (Twitter gave me an error that I'll try and fix later). But I would like to get this working with YouTube, any help is greatly appreciated thanks!


回答1:


Turns out I forgot to put in the appropriate details in my app.php

Laravel\Socialite\SocialiteServiceProvider::class,
\SocialiteProviders\Manager\ServiceProvider::class,

Note: I needed both of them!



来源:https://stackoverflow.com/questions/39261755/laravel-socialite-driver-youtube-not-supported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!