1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author Stefano Torresi (http://stefanotorresi.it) |
4
|
|
|
* @license See the file LICENSE.txt for copying permission. |
5
|
|
|
* ************************************************ |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace Thorr\OAuth2; |
9
|
|
|
|
10
|
|
|
use Zend\ModuleManager\Feature; |
11
|
|
|
|
12
|
|
|
class Module implements Feature\ConfigProviderInterface |
13
|
|
|
{ |
14
|
|
|
const DEFAULT_PASSWORD_SERVICE = 'Thorr\OAuth2\DefaultPasswordInterface'; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* {@inheritdoc} |
18
|
|
|
*/ |
19
|
|
|
public function getConfig() |
20
|
|
|
{ |
21
|
|
|
return [ |
22
|
|
|
'thorr_oauth' => [ |
23
|
|
|
// 'user_entity_class_name' => Entity\User::class, |
24
|
|
|
// 'bcrypt_cost' => 10, |
25
|
|
|
// 'third_party_grant_type_enabled' => false, |
26
|
|
|
'third_party_providers' => [ |
27
|
|
|
'facebook' => [ |
28
|
|
|
'class' => GrantType\ThirdParty\Provider\FacebookProvider::class, |
29
|
|
|
'options' => [ |
30
|
|
|
'app_id' => null, |
31
|
|
|
'uri' => 'https://graph.facebook.com/v2.0', |
32
|
|
|
'endpoint_params' => [], |
33
|
|
|
], |
34
|
|
|
], |
35
|
|
|
'instagram' => [ |
36
|
|
|
'class' => GrantType\ThirdParty\Provider\InstagramProvider::class, |
37
|
|
|
'options' => [ |
38
|
|
|
'client_id' => null, |
39
|
|
|
'uri' => 'https://api.instagram.com/v1', |
40
|
|
|
], |
41
|
|
|
], |
42
|
|
|
], |
43
|
|
|
], |
44
|
|
|
|
45
|
|
|
'service_manager' => [ |
46
|
|
|
'factories' => [ |
47
|
|
|
Options\ModuleOptions::class => Factory\ModuleOptionsFactory::class, |
48
|
|
|
Storage\DataMapperAdapter::class => Factory\DataMapperAdapterFactory::class, |
49
|
|
|
GrantType\ThirdPartyGrantType::class => Factory\ThirdPartyGrantTypeFactory::class, |
50
|
|
|
static::DEFAULT_PASSWORD_SERVICE => Factory\BcryptFactory::class, |
51
|
|
|
], |
52
|
|
|
'delegators' => [ |
53
|
|
|
'ZF\OAuth2\Service\OAuth2Server' => [ |
54
|
|
|
Server\ServerInitializer::class, |
55
|
|
|
], |
56
|
|
|
], |
57
|
|
|
], |
58
|
|
|
|
59
|
|
|
'zf-oauth2' => [ |
60
|
|
|
'storage' => Storage\DataMapperAdapter::class, |
61
|
|
|
'grant_types' => [ |
62
|
|
|
'jwt' => false, |
63
|
|
|
], |
64
|
|
|
], |
65
|
|
|
]; |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|