ezimuel / zend-expressive-api

Web API skeleton using zend-expressive
59 stars 30 forks source link

unsupported_grant_type #20

Open 5network opened 4 years ago

5network commented 4 years ago

Hello,

great api skeleton. But I got this error:

{
    "error": "unsupported_grant_type",
    "message": "The authorization grant type is not supported by the authorization server.",
    "hint": "Check the `grant_type` parameter"
}

in my oauth2.config.php i have:

return [
    'authentication' => [
        'private_key' => dirname(__DIR__) . '/../data/oauth2/private.key',
        'public_key' => dirname(__DIR__) . '/../data/oauth2/public.key',
        'encryption_key' => require dirname(__DIR__) . '/../data/oauth2/encryption.key',

        'access_token_expire' => 'P1D',
        'refresh_token_expire' => 'P1M',
        'auth_code_expire' => 'PT10M',

        'pdo' => [
            'dsn' => '...',
            'username' => '...',
            'password' => '...',
        ],

        'grants' => [
            Grant\ClientCredentialsGrant::class => Grant\ClientCredentialsGrant::class,
            Grant\PasswordGrant::class => Grant\PasswordGrant::class,
            Grant\AuthCodeGrant::class => Grant\AuthCodeGrant::class,
            Grant\ImplicitGrant::class => Grant\ImplicitGrant::class,
            Grant\RefreshTokenGrant::class => Grant\RefreshTokenGrant::class,
        ],
    ],
];