Hi @enrico, i can now get an JWT “access_token”! Thanks!
$app->route('/access_token', Zend\Expressive\Authentication\OAuth2\OAuth2Middleware::class, ['GET', 'POST'], 'oauth');
But i have now i little stupid question… I follow some doc and see also your “zendcon2017-api-tutorial”.
For authentication in my action, “zend-expressive-authentication” is used and i can retrieve a UserInterface::class in my action like in your tutorial. So i added this line in my module ConfigProvider.php and adapted for oauth2
'aliases' => [
AuthenticationInterface::class => Zend\Expressive\Authentication\OAuth2\OAuth2Adapter::class,
UserRepositoryInterface::class => Zend\Expressive\Authentication\OAuth2\UserRepository::class
I guess is almost correct… or not… but i got this error:
Service with name "Zend\Expressive\Authentication\AuthenticationMiddleware" could not be created.
Reason: AuthenticationInterface service is missing
Where this AuthenticationInterface service have to be create? Can you just help me please…