PHP code example of hagmann / zf-oauth2-doctrine

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

    

hagmann / zf-oauth2-doctrine example snippets


'modules' => [
   ...
   'ZF\OAuth2\Doctrine',
],

    'zf-mvc-auth' => array(
        'authentication' => array(
            'adapters' => array(
                'oauth2_doctrine' => array(
                    'adapter' => 'ZF\\MvcAuth\\Authentication\\OAuth2Adapter',
                    'storage' => array(
                        'storage' => 'oauth2.doctrineadapter.default',
                        'route' => '/oauth',
                    ),
                ),
            ),
        ),
    ),

'zf-oauth2' => array(
    'storage' => 'oauth2.doctrineadapter.default',
 public/index.php orm:schema-tool:create

'zf-oauth2-doctrine' => [
    'default' => [
        'enable_default_entities' => true,

'refresh_token_entity' => [
    'entity' => 'ZF\OAuth2\Doctrine\Entity\RefreshToken',
    'field' => 'refreshToken',
    'additional_mapping_data' => [
        'joinColumns' => [
            [
                'name' => 'user_id',
                'referencedColumnName' => 'user_id',
            ],
        ],
    ],
],


'zf-oauth2-doctrine' => [
    'default' => [
        'auth_identity_fields' => ['username', 'email'],
sh
$ php composer.phar 
config/oauth2.doctrine-orm.global.php.dist
oauth2.doctrine-orm.global.php