FOSOAuthServerBundle授权授权

时间:2016-08-17 14:35:10

标签: api rest symfony oauth2 fosoauthserverbundle

我正在 Symfony 3.1.1 中编写REST API,我在验证时遇到了一些问题。我正在使用 FOSOAuthServerBundle ,它运行正常。问题是客户不知道 client_id client_secret ,但他的用户名和密码......

我希望允许我的客户使用用户名和密码验证REST API, client_id client_secret

有可能吗?

提前致谢。 (对不起我的英语,我正在学习)

2 个答案:

答案 0 :(得分:0)

我在两种不同的场景中遇到了同样的问题,我通过以下方式解决了这个问题: - 使用知道client_id和client_secret的前端代理登录函数和端点 - 创建不需要cliend_id和client_secret的自定义授权。在Symfony 2.x中,您必须创建一个实现GrantExtensionInterface接口的类,并将其声明为标记为的服务:

tags: - { name: fos_oauth_server.grant_extension, uri: "http://whateveryouwahtn.tld/my_custom_grant" }

uri格式是oAuth的标准。该网址并不需要有效。

答案 1 :(得分:0)

使用密码凭据授予类型https://tools.ietf.org/html/rfc6749#section-4.3,它完全由捆绑包

支持
相关问题