Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oAuth without WebView on Android?

Is there a way to implement oAuth flow without actually launching browser or even a webview on android?

What I want to show is a native Popup which asks user credentials and then supply it to oAuth provider.

like image 362
VishJ Avatar asked Aug 16 '12 04:08

VishJ


2 Answers

Strictly speaking no, the main idea with OAuth is that you should never handle the user's credentials in any way.

But it depends on the provider. Twitter for example uses their own invention xAuth where you send the username and password in exchange for an access token. Twitter only allows this for applications that can motivate that need very well though.

So check with the API provider if it is possible in some way.

like image 113
Jon Nylander Avatar answered Nov 14 '22 23:11

Jon Nylander


Recently i did some research regarding implement oAuth without using browser or webview. Nowadays some platform already has native way by using their SDK like google: https://developers.google.com/identity/sign-in/android/, linkedin : https://developer.linkedin.com/docs/android-sdk-auth#. You can search for other platform too.

Another chance i see is by using google "Firebase" : https://firebase.google.com/docs/auth/. Even though i am not yet really try to implement it, as my understanding we can create our own custom input on HTML and pass it to their Javascript oAuth SDK to do credential login transaction. Just my guess we can do it with android native interface too.

Any correction are very welcome. Thanks.

like image 23
Bayu Avatar answered Nov 15 '22 00:11

Bayu