Setting up OAUTH

Discussion in 'Zend Framework 2 (ZF2) & Apigility' started by Colt, Apr 29, 2015.

  1. Colt

    Colt New Member

    I've been working with Alan to get OAUTH on my Apigility application. I have installed the new OAUTH and OAUTH PHP Server modules and I'm attempting to update my local config. I'm developing locally on Ubuntu using DB2 Connect.

    My local config currently looks like this.
    Code (Text):
    <?php
    return array(
        'db' => array(
            'adapters' => array(
                'api' => array(
                    'database' => 'MYDATABASE',
                    'driver' => 'IbmDb2',
                    'hostname' => '12.12.12.12',
                    'username' => 'USERNAME',
                    'password' => 'PASSWORD',
                    'port' => '446',
                    'driver_options' => array(
                        'DB2_ATTR_CASE' => DB2_CASE_LOWER,
                    ),
                ),
            ),
        ),
        'zf-oauth2' => array(
            'storage' => 'ZF\OAuth2\Adapter\IbmDb2Adapter',
            'db' => array(
                'driver' => 'IbmDb2',
                'database' => 'MYDATABASE',
                'driver' => 'IbmDb2',
                'hostname' => '12.12.12.12',
                'username' => 'USERNAME',
                'password' => 'PASSWORD',
                'driver_options' => array(
                    'DB2_ATTR_CASE' => DB2_CASE_LOWER,
                ),
            ),
        ),
    );
    When trying to access my api services, I'm receiving this error.
    ( ! ) Catchable fatal error: Argument 1 passed to ZF\MvcAuth\Authentication\OAuth2Adapter::__construct() must be an instance of OAuth2\Server, instance of ZF\OAuth2\Factory\OAuth2ServerInstanceFactory given, called in /var/www/api.myktag.com/httpdocs/vendor/zfcampus/zf-mvc-auth/src/Factory/DefaultAuthenticationListenerFactory.php on line 104 and defined in /var/www/api.myktag.com/httpdocs/vendor/zfcampus/zf-mvc-auth/src/Authentication/OAuth2Adapter.php on line 51
     
  2. Alan

    Alan Administrator Staff Member

    Looks like our preliminary IbmDb2 classes got out of sync with changes to the overall oauth-server-php classes. We'll address this and perhaps post something in the Learning Hall.
     

Share This Page