Search code examples
symfonyoauthsymfony4fosuserbundlefosoauthserverbundle

Create client oauth-server with password and client credentials


I'm deploying an update of an Api (symfony 4.1). I want to create de client oauth-server but I need both grant types (password and client_credentials). In the old deploying the api works with both grant types. How I specify password and client crendentials grant types?

I use this command:

php bin/console fos:oauth-server:create-client --redirect->uri="api/login" --grant-type="password"

or

php bin/console fos:oauth-server:create-client --redirect->uri="api/login" --grant-type="client_credentials"


Solution

  • Finally I found the solution. Put this in table 'client' column 'allowed_grant_types' of database:

    a:3:{i:0;s:8:"password";i:1;s:18:"client_credentials";i:2;s:10:"extensions";}