Twitter 从网站连接,没有弹出窗口

发布于 2024-11-05 08:33:23 字数 984 浏览 1 评论 0原文

我当前正在开发的网站遇到问题。

我在我的页面中添加了一个推文框,供用户发布有关当前文章的推文。如果用户从推文框提交并且当前未登录或未连接到我的网站,他/她会从 Twitter 收到一个弹出窗口,询问用户名/密码和/或他/她是否接受与我的网站的连接。

如果用户接受,弹出窗口就会关闭,一切都很好,如果用户拒绝,窗口就会关闭,推文仍然是一个梦想。

到目前为止一切顺利,但是!我的网站主要针对智能手机(特别是 iPhone),如果用户将我的网站添加到主屏幕(我推荐),那么 Twitter 弹出窗口将填充整个应用程序窗口。这个我可以理解,如果用户接受的话一切都会好起来的。

另一方面,如果用户拒绝,则没有窗口可供按钮关闭,因此会发生通知。我的网络应用程序正在全屏且独立运行,因此甚至没有后退按钮。因此,如果用户不接受 Twitter 连接,他/她基本上需要重新启动应用程序才能避免“弹出窗口”。

所以(最后;))我的问题是这样的;是否有一个 Twitter 页面可以执行不需要在弹出窗口中进行的连接身份验证?一个页面在接受和取消时基本上都会将您发送回回调 URL?还是有我忽略的不同方法?

期待一些有用的提示!

编辑


有人建议我标准OAuth流程Web 意图,问题是该应用程序只需客户端代码/javascript。这使得标准 OAuth 流程变得不可能,因为它通过 http/https 发送应用程序机密,这使我将机密放入 javascript 中(我可能是一个业余程序员,但有限制;))。

Web 意图页面没有取消/后退按钮,因此如果用户不想连接并在独立模式下运行我的应用程序,我仍然会陷入困境。

我想我应该将其包含在原始帖子中,无论如何感谢您的建议。

I have a problem with a website I'm currently working on.

I have added a Tweet box to my page for the user to tweet about the current article. If the user submits from the Tweet box and is not currently logged in or is not connected with my site, he/she gets a popup from twitter asking for username/password and/or if he/she accepts the connection with my site.

If the user accepts the popup is closed and all is good, if the user declines the window is just closed and the tweet remains a dream of what could have been.

So far so good, But! My site is mainly aimed at smartphones (in particular iPhone), and if the user adds my site to the home screen (which I recommend) then the twitter popup fills the whole app window. This I can understand, and everything works out if the user accepts.

If, on the other hand the user declines, there is no window for the button to close so noting happens. My webapp is running fullscreen and standalone so doesn’t even have a back button. So if the user doesn’t accept the twitter connect, he/she basically needs to restart the app to get avay from the “popup”.

So (finally ;) ) my question is this; is there a twitter page that performs the connect authentication that is not required to be in a popup? A page that basically sends you back to the callback url on both accept and cancel? Or is there a different approach that I have over looked?

Looking forward to some helpful tips!

EDIT


I was suggested The standard OAuth flow and Web intents, the problem is that the app needs to be client code/javascript only. This makes The standard OAuth flow impossible because it sends application secrets over http/https wich makes me put the secrets in the javascript ( I might be somewhat of a hobbyist programmer but there are limits ;) ).

Web intent pages don't have a cancel/back button so I'm still stuck if the user dont want to connect and is running my app in stanalone mode.

I guess I should have included this in the original post, thanks anyway for the suggestions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心房敞 2024-11-12 08:33:23

Twitter 的标准 OAuth 流程不需要弹出窗口。您可以重定向当前窗口。然后,您必须自行处理提交的表单,并通过您的发布状态服务器。

您还可以查看Web Intents。用户从移动优化的 twitter.com 页面发布推文。

The standard OAuth flow for Twitter does not require a popup. You can instead redirect the current window. You will then have to process the the form submit yourself and post the status through your server.

You might also checkout Web Intents. The user posts the tweet from a mobile optimized twitter.com page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文