如何重新认证NATIVE DESKTOP Facebook应用 [英] How to re-authenticate NATIVE DESKTOP Facebook app

查看:115
本文介绍了如何重新认证NATIVE DESKTOP Facebook应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读有关与Facebook的Native Desktop应用程序编程相关的所有Facebook文档。我明确声明了本机桌面应用程序。

I'm in the progress of reading all documentation of Facebook related to programming a Native Desktop application for Facebook. I explicitly state Native Desktop app. It will be using Client Side authentication WITHOUT the JAVA SDK.

据我所读,我知道access_tokens确实会过期。我还读到您可以重新进行身份验证。但是……... Facebook的文档非常有限,关于如何使用不带JAVA SDK的客户端身份验证在Windows / Mac OSX或Linux上运行的桌面应用程序执行此操作。

As far as I have read, I know that access_tokens do expire. I've also read that you can re-authenticate. But........... Facebook has very limited documentation about how to do that with a desktop application running on Windows/Mac OSX or Linux using Client Side Authentication without the JAVA SDK.

我的问题是……对于这样的Facebook桌面应用程序,还是有可能吗?还是在access_token每次到期时都要询问用户,以再次授权我的应用程序?

My question is...... Is this possible anyway for such a Facebook desktop app or do I have to ask the user every time the access_token expires, to authorize my application again?

重要提示:Facebook不支持 offline_access 权限功能/ API(解决方案可以

Important note: Facebook does not support the offline_access permission function/API (what a solution could have been) anymore.

推荐答案

找到了解决方案。

是的,本地桌面客户端可以重新进行身份验证。 access_tokens(在用户进行应用程序身份验证期间由Facebook提供)构成用户,Facebook和我的桌面应用程序之间的连接。此access_token(111个令牌的字符串)有效期为60天。到期时,用户必须再次进行身份验证,但不必再次标记所有选项来指定本机桌面应用程序可能具有的权限。

Yes it is possible for a Native Desktop client to re-authenticate. The access_tokens (given by Facebook during app authentication by the user) forms the connection between the user, Facebook and my Desktop app. This access_token (a string of 111 tokens) is valid for 60 days. When it expires the user must authenticate again BUT does not have to mark all options again to specify the permissions my Native Desktop App may have.

那么,这只是一个问题。用户使用

It is then just a matter for the user to log onto facebook using the

https://www.facebook.com/dialog/oauth?client_id=YourAppClientIDGivenByFacebookDuringAppRegistration&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=PermissionsScope

再一次,他或她无需执行任何其他操作(只需使用具有正确权限范围的正确URL进行登录即可)。然后,我的桌面应用程序的用户将重定向到仅显示成功消息的URL。

again without any other action he or she have to do (just a login with the right URL with the right scope of permissions and thats it). The user of my Desktop app is then redirected to a URL that just shows the messages Success.

因此,您需要使用浏览器或通过代码自己处理http获取和发布请求。

So you need a browser or you need to handle http get and post requests by code yourself.

这篇关于如何重新认证NATIVE DESKTOP Facebook应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆