Skip to content

Instantly share code, notes, and snippets.

@ezimuel
Created December 9, 2014 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ezimuel/b3f5a07486bf9c8903c1 to your computer and use it in GitHub Desktop.
Save ezimuel/b3f5a07486bf9c8903c1 to your computer and use it in GitHub Desktop.
Example: OAuth2 configuration for Apigility
// config/autoload/global.php
// ...
'router' => array(
'routes' => array(
'oauth' => array(
'options' => array(
'route' => '/oauth',
),
),
),
),
// ...
// config/autoload/local.php
// ...
'zf-oauth2' => array(
'storage' => 'ZF\\OAuth2\\Adapter\\PdoAdapter',
'db' => array(
'dsn_type' => 'PDO',
'dsn' => 'sqlite:/path-to-apigility/vendor/zfcampus/zf-oauth2/data/dbtest.sqlite',
'username' => null,
'password' => null,
),
),
// ...
// module/Test/config/module.config.php
// ...
'zf-mvc-auth' => array(
'authorization' => array(
'Test\\V1\\Rest\\Ping\\Controller' => array(
'entity' => array(
'GET' => false,
'POST' => false,
'PATCH' => false,
'PUT' => false,
'DELETE' => false,
),
'collection' => array(
'GET' => true,
'POST' => true,
'PATCH' => true,
'PUT' => true,
'DELETE' => false,
),
),
),
),
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment