适用于 Android 的 Adobe AIR 上的无引脚 OAuth
我在 Adobe AIR for Desktop、iOS 上使用了无引脚 OAuth,但在 Android 上则不行。 由于某种原因,我们没有得到 oauth_verifier (其中包含 Android 设备上 StageWebView 中的 sha'd 代码)。有什么线索吗?这是 在桌面和 Droid 2 上进行调试;请注意 Droid 2 跟踪输出中缺少的第三行 回调 URL 后面的所有 OAuth 变量。
桌面:
AuthorizeTwitterService::onComplete, data:
oauth_token=De2k4zANjzAhT3hXV4eqOfTVxJsshVIJjgsuwPMUg8&oauth_token_secret=s WsBzyS43nh6DDBwLaogaWpVftoDaiYTJDfBKQE&oauth_callback_confirmed=true
--------------------
TwitterLoginView::onLocationChange
location:
https://api.twitter.com/oauth/authorize?oauth_callback=oob&applicatio...
--------------------
TwitterLoginView::onLocationChange
location: https://api.twitter.com/oauth/authorize
--------------------
TwitterLoginView::onLocationChange
location:
http://www.twitter.com/combovercharlie?oauth_token=De2k4zANjzAhT3hXV4&oauth_verifier=js1B4bAYfUer05a2rlZSDcOLOaIa66q93K24FUzrk
Droid 2:
AuthorizeTwitterService::onComplete, data:
oauth_token=BtwJHbpaS5OWy1AMYdwl0ecGKGpU9AEcyrFYaXQ8&oauth_token_secret=Z2C ff3ECfY5dp8dLLSA9qXvL2SRaZ3v5veStGuA00&oauth_callback_confirmed=true
--------------------
TwitterLoginView::onLocationChange
location:
https://api.twitter.com/oauth/authorize?oauth_callback=oob&applicatio...
Charlie&oauth_token=BtwJHbpaS5OWy1AMYdwl0ecGKGpU9AEcyrFYaXQ8&oauth_consumer _key=LbMYslVau91uSAMZyGsOg
--------------------
TwitterLoginView::onLocationChange
location: https://api.twitter.com/oauth/authorize
--------------------
TwitterLoginView::onLocationChange
location: http://mobile.twitter.com/combovercharlie
I got pinless OAuth working on Adobe AIR for Desktop, iOS, but not Android.
For some reason, we're not getting the oauth_verifier (which contains the
sha'd code) in StageWebView on an Android device. Any clue? Here's the
debug for on desktop and on Droid 2; notice the 3rd line in the Droid 2 trace output which is missing
all the OAuth variables after the callback URL.
Desktop:
AuthorizeTwitterService::onComplete, data:
oauth_token=De2k4zANjzAhT3hXV4eqOfTVxJsshVIJjgsuwPMUg8&oauth_token_secret=s WsBzyS43nh6DDBwLaogaWpVftoDaiYTJDfBKQE&oauth_callback_confirmed=true
--------------------
TwitterLoginView::onLocationChange
location:
https://api.twitter.com/oauth/authorize?oauth_callback=oob&applicatio...
--------------------
TwitterLoginView::onLocationChange
location: https://api.twitter.com/oauth/authorize
--------------------
TwitterLoginView::onLocationChange
location:
http://www.twitter.com/combovercharlie?oauth_token=De2k4zANjzAhT3hXV4&oauth_verifier=js1B4bAYfUer05a2rlZSDcOLOaIa66q93K24FUzrk
Droid 2:
AuthorizeTwitterService::onComplete, data:
oauth_token=BtwJHbpaS5OWy1AMYdwl0ecGKGpU9AEcyrFYaXQ8&oauth_token_secret=Z2C ff3ECfY5dp8dLLSA9qXvL2SRaZ3v5veStGuA00&oauth_callback_confirmed=true
--------------------
TwitterLoginView::onLocationChange
location:
https://api.twitter.com/oauth/authorize?oauth_callback=oob&applicatio...
Charlie&oauth_token=BtwJHbpaS5OWy1AMYdwl0ecGKGpU9AEcyrFYaXQ8&oauth_consumer _key=LbMYslVau91uSAMZyGsOg
--------------------
TwitterLoginView::onLocationChange
location: https://api.twitter.com/oauth/authorize
--------------------
TwitterLoginView::onLocationChange
location: http://mobile.twitter.com/combovercharlie
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过 Event.COMPLETE 为我的 Droid 2 和 Nexus One 修复了这个问题。我什至没有在我的桌面上或 Android 上获得 LocationChangeEvent.LOCATION_CHANGING,但最重要的是,Event.COMPLETE 确实获得了 oauth_verifier sha'd pin。我可以从 StageWebView 的位置属性中解析它,然后提交,然后就可以开始了。出于偏执,我将所有 3 个事件都留在那里以防万一。如果您好奇,以下是 Mark Lochrie 介绍的操作系统之间的重定向事件差异: http:// kb2.adobe.com/cps/895/cpsid_89526.html。
另外,假设您的应用程序实际上注册为“Web 应用程序”,而不是桌面应用程序,否则,您将被迫使用 PIN,并且您将无法在响应 URL 中获得 oauth_verifier。是的,您可以根据需要编写回调 URL;只需确保它是一个标准 URL,希望不会出现 404 错误。
I fixed it via Event.COMPLETE for my Droid 2 and Nexus One. I'm not even getting a LocationChangeEvent.LOCATION_CHANGING on my desktop nor Android, but bottom line, Event.COMPLETE does get the oauth_verifier sha'd pin in it. I can parse that out of StageWebView's location property, submit, and I'm good to go. Out of paranoia, I'm leaving all 3 events in there just in case. If you're curious, here's the redirect event differences between OS's via Mark Lochrie: http://kb2.adobe.com/cps/895/cpsid_89526.html.
Also, it's assumed your application is actually registered as a "web application", and not a desktop application, otherwise, you'll be forced to use a pin, and you won't get the oauth_verifier in the response URL. Yes, you can make up a callback URL to whatever you want; just make sure it's a standard URL that hopefully doesn't 404.