我正在开发一个python应用程序,该应用程序允许我将更新/状态发布到Facebook.
I am working on a python application which allows me to post updates/statuses to Facebook.
我在获取访问令牌时面临一个基本问题.
I am facing a basic problem with getting access tokens.
由于此应用程序可以在桌面上运行,因此毫无疑问使用某些Web服务器.
Since this application is working on the desktop, there is no question of using some web server.
我知道我必须打开一个网址:
I understand that I have to open a URL:
www.facebook/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=www.facebook/connect/login_success.html..并从重定向的URL中获取令牌.
..and get the tokens out of the redirected URL.
但是,即使这样也不可行,因为我的是基于控制台的应用程序.我最接近使用嵌入式浏览器的是使用Python的mechanize模块.
But even this is out of option, since mine is a console based application. The closest I can get to using embedded browser is by using Python's mechanize module.
还有其他选择吗?
推荐答案也许您可以通过一些设置过程来获取具有脱机访问权限的令牌,这样,仅向用户显示一次Facebook登录页面即可,然后您稍后可以在控制台应用程序中使用此令牌.
Maybe you can have some setup process where you obtain the tokens with offline access, that way the user will need to be presented with facebook login page only once, then you use this token later with the console app.
在 developers.facebook/docs/authentication/permissions/上查看offline_access
更多推荐
用于桌面(基于控制台)的Facebook身份验证应用程序
发布评论