首页 > 解决方案 > 使用密码和客户端凭据创建客户端 oauth-server

问题描述

我正在部署 Api (symfony 4.1) 的更新。我想创建 de 客户端 oauth-server,但我需要两种授权类型(密码和 client_credentials)。在旧的部署中,api 适用于两种授权类型。如何指定密码和客户端凭据授予类型?

我使用这个命令:

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

或者

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

标签: symfonyoauthsymfony4fosuserbundlefosoauthserverbundle

解决方案


最后我找到了解决方案。把它放在数据库的表 'client' 列 'allowed_grant_types' 中:

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


推荐阅读