有没有为Android生产质量的OAuth样? [英] Is there a production quality OAuth sample for Android?

查看:97
本文介绍了有没有为Android生产质量的OAuth样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多的样品摆在那里,特别是对微博。这一次似乎是最为齐全的企业之一,所以我一直在黑客就可以了:

There are plenty of samples out there, especially for Twitter. This one seems to be one of the most complete so I've been hacking on it:

https://github.com/brione/Brion-Learns-OAuth

不过,所有样品基本都是概念code证明。他们都喜欢留下一个拆分任务的堆栈在启动通过浏览器粗糙的边缘。我已经得到了应用程序,我玩的工作主要是我想要的方式宣布其singleTask,迫使浏览器回调到原来的任务,而不是开始一个新的活动:

However, all of the samples are basically proof of concept code. They all have rough edges like leaving a split task stack when you launch through the browser. I've got the app I'm playing with working mostly the way I want it to by declaring it singleTask and forcing the browser to call back into the original task instead of starting up a new activity:

<activity android:name=".MainActivity"
              android:label="@string/app_name"
              android:launchMode="singleTask">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>

不过,我不知道是否有更好的方法来处理这​​个问题,像雨后春笋般冒出来一个模式的WebView采取通过身份验证过程中,用户?

However I'm wondering if there are better ways to handle this, like popping up a modal WebView to take the user through the auth process?

我假设Twitter的,尤其是正确的事情很可能是交换到XAUTH。但我还是想知道,一般来说,是有一个最佳实践的生产质量的OAuth实现机器人在那里?

I'm assuming that for Twitter in particular the "right" thing to do is probably to swap to xauth. But I still would like to know, generally speaking, is there a best-practice production quality OAuth implementation for Android out there?

推荐答案

也许下面的例子将是任何帮助:

Maybe the following example will be of any help:

https://github.com/ddewaele/An​​droidOAuthFlowSample/tree/latitude_branch

这篇关于有没有为Android生产质量的OAuth样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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