Facebook 设备流支持
根据 Facebook 文档,OAuth 设备流受支持。
但是,当我按照他们的指示启动设备流流程时,我收到状态代码 400(方法未实现)。
有人能够成功让 Facebook Device Flow 流程正常运行吗?
curl -X post https://graph.facebook.com /oauth/device?type=device_code&client_id={appId}
<HTML>
<HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD>
<BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY>
</HTML>
According to the Facebook docs, OAuth Device Flow is supported.
However, when I follow their directions on starting the Device Flow process, I receive a status code of 400 (Method not implemented).
Has anyone successfully able to get the Facebook Device Flow process functioning?
curl -X post https://graph.facebook.com/oauth/device?type=device_code&client_id={appId}
<HTML>
<HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD>
<BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY>
</HTML>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
关于您的具体错误,似乎 facebook 文档让您做错了: FAIL
您必须发送 POST 请求,您要求 cURL 执行此操作,但请求数据不能是 URL 的一部分。相反,您应该使用 -d 选项来指定发送的数据并使用 ? 之前的 URL。标志,如所示超级用户问题
但是!即使您使用了正确的 HTTP 方法,您也会收到一条错误消息:
现在最好的部分:除非您使用 facebook 本身用于 他们的演示!在这种情况下,您会收到 200(OK)响应,其中包含预期的代码、user_code 和verification_uri。显然他们的应用程序与我们正在尝试的应用程序有些不同。应用程序配置页面中没有关于此的提示。
顺便说一句,我还没有发现有人声称成功使用了 facebook 的 Device Flow,是吗?
About your specific error, it seems facebook docs made you do it wrong: FAIL
You must send a POST request, which you're asking cURL to do, but request data must not be part of the URL. Instead, you should use the -d option to specify the sent data and use the URL up to the ? sign, like shown in this superuser question
But! Even if you used the right HTTP method, you'd get an error that reads:
Now the best part: this happens unless you use the client_id facebook themselves used for their demo! In that case, you get a 200 (OK) response with the expected code, user_code and verification_uri. Apparently their application is somehow different from those we're trying with. No hint in the app configuration page about this.
By the way, I haven't found anyone claiming to have successfully used facebook's Device Flow, have you?
这是一个示例实现,但我还没有设法让它与我自己的项目一起工作:
https://oauth-device-demo.appspot.com/
Here's an example implementation, but I haven't managed to get it working with my own project:
https://oauth-device-demo.appspot.com/
我也遇到了同样的错误。
看这篇文章
http://forum.developers.facebook.net/viewtopic.php? id=105132
是教你如何设置app的,但是尝试之后没有任何改变~
你可以尝试一下~
I also encountered the same error.
look this article
http://forum.developers.facebook.net/viewtopic.php?id=105132
it's teach your how set app, but after trying, nothing change~
you can try~