Is there an OAuth sample for product quality for Android?

There are many samples, especially for Twitter. This one seems to be one of the most complete, so I cracked it:

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

However, all samples are mainly proof of concept code. All of them have rough edges, for example, leaving a broken task stack when launched through the browser. I have an application in which I play, working basically the way I want, declaring it singleTask and causing the browser to go to the original task instead of starting a new action:

<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> 

However, I am wondering if there are better ways to handle this, for example, popping a modal WebView so the user can go through the auth process?

I guess for Twitter, in particular, the β€œright” thing is probably to exchange for xauth. But I still would like to know, generally speaking, is there anything different from OAuth, the quality of execution for Android there?

+3
source share
2 answers
+1
source

Been there, done it. The above examples of androids almost always skip some important details or are simply not updated. This is why I wrote easy to follow resumes, like I did OAuth on android a few days ago:

http://nilvec.com/implementing-client-side-oauth-on-android/

I can also publish the OAuth helper class that I implemented if anyone is interested.

+1
source

Source: https://habr.com/ru/post/885550/


All Articles