用于桌面(基于控制台)的Facebook身份验证应用程序

编程入门 行业动态 更新时间:2024-10-27 02:30:23
本文介绍了用于桌面(基于控制台)的Facebook身份验证应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在开发一个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身份验证应用程序

本文发布于:2023-11-12 19:13:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控制台   应用程序   身份验证   桌面   Facebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!