kayrules / lumen-passport-mongodb

Making Laravel Passport work with Lumen
MIT License
6 stars 7 forks source link

Fix OAuth routes to Lumen 5.7 #4

Closed lucascardial closed 5 years ago

lucascardial commented 5 years ago

Hello @kayrules . When will you post this update to packagist?

kayrules commented 5 years ago

Hi @lucca-cardial, thanks for the PR. already updated the packagist pointing to v0.3.0

lucascardial commented 5 years ago

Do you think to update the dependency of @moeen-basra/laravel-passport-mongodb? This project is using version 1.0.18, where the makeAuthorizationServer method in PassportServiceProvider is not setting theEncryptionKey. I tried to run some tests with version 4.0 @moeen-basra/laravel-passport-mongodb, but many errors occurred.

lucascardial commented 5 years ago

I made a modification to the vendor of MoeenBasra \ LaravelPassportMongoDB \ PassportServiceProvider :: makeAuthorizationServer (line 196):

public function makeAuthorizationServer()
    {
        $authorizationServer = new AuthorizationServer(
            $this->app->make(Bridge\ClientRepository::class),
            $this->app->make(Bridge\AccessTokenRepository::class),
            $this->app->make(Bridge\ScopeRepository::class),
            'file://'.Passport::keyPath('oauth-private.key'),
            'file://'.Passport::keyPath('oauth-public.key')
        );

        $authorizationServer->setEncryptionKey(env('APP_KEY'));

        return $authorizationServer;
    }
lucascardial commented 5 years ago

With this modification, I can generate passport tokens normally. The problem is that I can not test version 4.0 that already fixes this. Other errors arise. I'm thinking of cloning only version 1.0.18 and uploaded it to my repository and packagist.