Hi, just trying your module and have few quesions.
I set up Apigility, and oAuth2.
I can make POST to /oauth
{"grant_type":"password", "username":"testuser", "client_id":"testclient2", "password":"testpass" }
('testuser' is stored in oauth tables - oauth_users
) and got response:
{"access_token":"e59610ddeab7dd559bcea5e25e46092c7d8f25b1","expires_in":3600,"token_type":"Bearer","scope":null,"refresh_token":"10e6a1769bd133bb766bd87fdea5d86e51d4af1a"}
I believe oauth as is - is working.
I installed zfc user tested /user/login (sing up, login, logout - everything works)
Now I installed LdcZfcUserOAuth2 module, config it by instruction
- in \vendor\zfcampus\zf-oauth2\config\module.config.php - I added in 'zf-oauth2' => array
'zf-oauth2' => array(
'storage' => 'ldc-zfc-user-oauth2-storage-pdo',
'db' => array(
'dsn' => 'mysql:dbname=mydevtest;host=localhost',
'username' => 'mydevtest',
'password' => 'pass',
),
in this step I must add also 'db' because without it I got error "...configuration ['zf-oauth2']['db'] for OAuth2 is missing..."
- From \vendor\zf-commons\zfc-user\config\ i copy file 'zfcuser.global.php.dist' to \config\autoload and renamed it to 'zfcuser.global.php' - inside that file I changed 'auth_adapters' to:
'auth_adapters' => array( 100 => 'ldc-zfc-user-oauth2-authentication-adapter-db' ),
After that I test POST to /oauth with user/pass combination from ZFCUser (user) table (created in step when testing ZFCUser's /user/login):
{"grant_type":"password", "username":"[email protected]", "client_id":"testclient2", "password":"password"}
and response is:
{"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","title":"invalid_grant","status":401,"detail":"Invalid username and password combination"}
If i try user/pass from oauth table it works. It seems that it does NOT look for user/pass from ZFC user table..
Any idea/hint how to solve this?
Thnx