OAuth2资源所有者密码凭据流是否仅需要以下信息进行身份验证:
grant_type: password
username: test@test.de
password: test
还是需要 client_id
和 client_secret
?我问,因为我想和Doorkeeper一起使用Ember-Simple-Auth . 两者都实现了流程,但Ember-Simple-Auth没有使用 client_id
和 client_secret
,而Doorkeeper需要这些信息才能工作 . 所以我认为其中一个没有正确实现OAuth2规范 .
Edit 1:
我之前也查看了规格,但我想确定,在我填写门把宝石的错误报告之前,但规格中还有这一部分:
如果客户端类型是机密或客户端已获得客户端凭据(或分配了其他身份验证要求),则客户端必须使用授权服务器进行身份验证,如第3.2.1节中所述 .
Edit 2
在查看ember-simple-auth的测试时,我看到它还测试了请求参数 client_id
和 client_secret
. 因此,我深入研究了代码,并了解了如何设置id和秘密 .
App.LoginController = Ember.Controller.extend(Ember.SimpleAuth.LoginControllerMixin, {
client_id: 'id',
client_secret: 'secret'
})
Edit 3
自从Ember-SimpleAuth进行了大量重构以来,编辑2中显示的解决方案不再适用 . 但是门卫也会改变,现在 client_id
和 client_secret
是可选的 .
1 回答
您确定同时使用资源所有者密码凭据流实现oAuth吗?
查看spec,并在资源所有者密码凭据流中看到,不需要client_id和client_secret .
在Authorization Code Grant中,规范强制客户端传递* client_id和client_secret *,但在4.3.1中它表示auth-server需要客户端身份验证FOR CONFIDENTIAL CLIENTS . 当客户端不是"confidential"时,规范会将其打开 . 如果在上面的问题(@Doorkeeper)的情况下,客户端不是"confidential" - 可能不需要client_id ...