drh37116 2018-02-04 12:44
浏览 389
已采纳

构建[League \ OAuth2 \ Server \ AuthorizationServer]时,目标[League \ OAuth2 \ Server \ Repositories \ ClientRepositoryInterface]无法实例化

I've recently set up a new Laravel 5.5 project on Ubuntu 16.04 with an NGINX server. I've followed all the correct steps and double checked everything more than once. I've installed Laravel/Passport and double checked those set up instructions as well.

I'm building an API that requires a login for most endpoints, which is done via password_grant with laravel/passport but can also consumes a Facebook auth token - instead of writing my own Facebook Auth Token verify, I've chosen to use a larval plugin. composer require danjdewhurst/laravel-passport-facebook-login However, this plugin doesn't seem to install easily for me.

I am receiving an error on any composer install or update command I issue:

Target [League\OAuth2\Server\Repositories\ClientRepositoryInterface] is not instantiable while building [League\OAuth2\Server\AuthorizationServer].

I have played around with the config/app.php file as well as the uses for all of the files and providers that were installed with the plugin. I have gone through every post here to try and fix the issue as well.

If anyone has any insight or a fix for this issue I'd appreciate it. Any help would help.

Thank you.

  • 写回答

2条回答 默认 最新

  • duannai1883 2018-02-05 13:37
    关注

    I found this to be an issue with the order of Laravel's auto discovery of packages. Obviously the Facebook Grant package needs to load after laravel/passport but this was not happening.

    My solution was to add the following to my composer.json:

    "extra": {
        "laravel": {
            "dont-discover": [
                "laravel/passport",
                "danjdewhurst/laravel-passport-facebook-login"
            ]
        }
    }
    

    and then the following to my config/app.php in the providers array:

    \Laravel\Passport\PassportServiceProvider::class,
    \Danjdewhurst\PassportFacebookLogin\FacebookLoginGrantProvider::class,
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 docker实践项目
  • ¥15 数电几道习题,写出作答过程,ai一律不采用
  • ¥15 利用pthon计算薄膜结构的光导纳
  • ¥15 海康hlss视频流怎么播放
  • ¥15 Paddleocr:out of memory error on GPU
  • ¥30 51单片机C语言数码管驱动单片机为AT89C52
  • ¥100 只改动本课件的 cal_portfolio_weight_series(decision_date), 跑完本课件。设计一个信息比率尽量高的策略。
  • ¥20 如何在visual studio 2022中添加ImageMagick库
  • ¥50 如何实现uniapp编译的微信小程序做可回溯视频
  • ¥15 stm32用5个IO口接16个矩阵按键怎么设计PCB原理图啊