An extension for zf-oauth2
allowing use of ZfcUser as authentication source
-
Install module using Composer
composer require adamlundrigan/ldc-zfc-user-oauth2:<version>
-
Enable required modules in your
application.config.php
file:- ZfcBase
- ZfcUser
- LdcZfcUserOAuth2
-
Configure ZfcUser
-
Override the
zf-ouath2
configuration to use the provided storage provider:return array( 'zf-oauth2' => array( 'storage' => 'ldc-zfc-user-oauth2-storage-pdo', ), );
-
Override the authentication adapter used by ZfcUser. Locate the
auth_adapters
key in yourzfc-user.global.php
config file and replace it with this:'auth_adapters' => array( 100 => 'ldc-zfc-user-oauth2-authentication-adapter-db' ),
- Use ZfcUser's authentication mechanism in OAuth2 server
- Populate ZfcUser auth storage when OAuth2 server authentication succeeds
- Some tests might be a good idea
- Some documentation and an example might also be good ideas