0

I am developing a native app that uses OAuth2 for user authentication to a web app. When user asks for authentication, the system browser starts via Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(myLinkHere)), the login page is displayed, user inserts their username/password and the access_token is returned to the app.

My problem is that when the user has saved their credentials in the browser and an authentication request comes about, then the browser starts momentarily and the flow returns to the app right away. Is there any way to hide from the user the opening of the browser or to open it in background so as to avoid this bad user experience?

maria
  • 21
  • 2
  • What about a WebView? – Ahmed Hegazy May 18 '15 at 10:53
  • I haven't tested a WebView, but since it is a view created in the app I suppose that in that case the user will always have to insert their credentials, aren't they? – maria May 18 '15 at 11:00
  • It's like a browser that is embedded in your app. – Ahmed Hegazy May 18 '15 at 11:01
  • like this http://www.learn2crack.com/2014/01/android-oauth2-webview.html – Ahmed Hegazy May 18 '15 at 11:05
  • I will check it and get back to you, thank you! – maria May 18 '15 at 11:10
  • I am able to control the visibility of the browser using a WebView indeed, however this solution is not applicable to my case scenario, as according to the documentation: "Saving passwords in WebView will not be supported in future versions". Thank you for your reply anyway! – maria May 20 '15 at 10:22
  • @maria Have you got any solution for this – Prabs Jul 31 '15 at 07:04
  • No, I cannot prevent the momentary emergence of the system browser. If you find something and let me know, I would appreciate it! – maria Jul 31 '15 at 08:28
  • @maria Your motto is to hide the browser which will pop-up for few moments before it starts downloading the pdf,right.?? Even am trying to download the file within my app but am not finding it anywhere how to do it,tried through webview but its very lengthy. `webview.setDownloadListener(..)` – Prabs Jul 31 '15 at 09:59
  • Hmm... I want to open a web page where the user signs in and then return the flow to my app. My problem occurs when the system browser has already saved the credentials, a fact that results to a "flash": the system browser opens and closes rapidly. However, in your case have you tried downloading the file using an HTTP request instead of starting the browser? [http://stackoverflow.com/questions/3505930/make-an-http-request-with-android] – maria Jul 31 '15 at 11:54
  • Hello @maria Task completed.I've called the Async class #2 from onPost and defined the #2 class outside of #1.Given progress dialogs and alerts to control the downloading.Now it is downloaded within app :) [Check this](http://stackoverflow.com/q/31744619/4361127) follow the sonic comments – Prabs Aug 01 '15 at 05:36

0 Answers0