2014-04-01 61 views
7

Facebook提供有关oauth登录参数的一些文档。Facebook oauth授权URL和参数选项

Login Dialog OAuth 2

的参数是:

  • 的client_id =您的应用程序ID
  • REDIRECT_URI =您的应用程序网站网址
  • 显示=页面,弹出窗口,iframe中,异步触摸。如何显示登录。
  • scope =权限名称。您的应用允许用户授予您的应用的权限。
  • state =返回到您的应用程序的响应中包含的字符串。
  • response_type =代码或令牌或两者。根据授权流程以不同方式使用。

是否有更多有关不同类型的oauth功能及其参数的信息?

我想知道如何构造oauth的URL。我知道一些配置。例如:

https://www.facebook.com/dialog/oauth? 
    client_id=YourAppID 
    &redirect_uri=The URL that you designated in your App Settings for your App 
    &response_type=token //Whether you want a `code` returned, or a `token` returned, or both 
    &scope=publish_stream // scope prompts the user for the type of permissions being asked for 

我看到了一个讨论中表现出这样的:

https://graph.facebook.com/oauth/authorize? 
    client_id=123456789 
    &redirect_uri=http://example.com/ 
    &scope=publish_stream,share_item,offline_access,manage_pages 

注意网址的区别的:

/dialog/oauth? 

/oauth/authorize? 

什么authorize做?它是否授予权限而不是提问权限?这个文件在哪里?

回答

1

https://graph.facebook.com/oauth/authorize也是登录人 - 就像对用户进行身份验证并从用户那里获取权限是否通过应用访问请求的权限。

oauth/authorize是图形API调用。 我认为主要的差异可能是当你想手动建立登录流程时,你应该使用/ oauth/authorize ..否则如果你使用javascript/Apps api提供的faciss它使用/ dialog/oauth。应用程序通常需要确认来自“登录”对话框的响应是由启动它的同一个人完成的。如果您使用的是Facebook的JavaScript SDK,它会自动执行这些检查,因此无需任何操作,假设您只是从浏览器拨打电话。我们可以通过应用appsecret_proof来使图形API调用安全。