Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23336] Android: Titanium WebView fails at authentication

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2016-05-09T02:32:11.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
LabelsTi.UI.WebView, WebView, android, ipass1
ReporterLee phela
AssigneeAshraf Abu
Created2016-04-27T19:46:24.000+0000
Updated2018-08-06T17:37:05.000+0000

Description

(function(){
	var win=Ti.UI.createWindow({
		exitOnClose:true
	});
	win.addEventListener("open",function(e){
		var webView=Ti.UI.createWebView({
			top:0,
			bottom:0,
			right:0,
			left:0,
			borderWidth:0,
			url:"https://www.instagram.com"
		});
		win.add(webView);
	});
	win.open();
}());
DESCRIPTION: When trying to login to Instagram via Facebook using webview, the authentication process never gets completed but remain stuck forever halfway into the process. On normal browser and other apps(not written on titanium) using the same webview android component, this is never the case. The authentication process and everything went all well as expected and successfully takes the user to the Instagram homepage. So obviously, this is a bug associated only with Titanium or otherwise similar other apps would behave similarly as was the with the titanium webview. I have only tested on IG at the moment, but I'm sure this problem can occur to a lot of other sites too, thus hampering the development of webview based app to a lot of extent. STEP to reproduce: 1. Copy the pasted code above into the app.js and run the app. 2. Now, login to your Instagram account using Facebook. 3. the authentication process never successfully went through but stuck somewhere into the middle. On careful examination, a warning message is generated that tells something like this produced -
[WARN] :   chromium: [WARNING:spdy_session.cc(2566)] Received WINDOW_UPDATE for invalid stream 5
Not sure if the warning has got to do anything with it.

Attachments

FileDateSize
screen.png2016-04-27T19:34:56.000+000014282

Comments

  1. Nazmus Salahin 2016-04-28

    Hello, I am unable to reproduce this issue with given code and given step. There is no authentication problem occurred. *Steps:* 1. Create a default classic project. 2. Replace code in app.js with following.
       var win = Ti.UI.createWindow({
       
       	exitOnClose : true
       
       });
       
       win.addEventListener("open", function(e) {
       
       	var webView = Ti.UI.createWebView({
       
       		top : 0,
       
       		bottom : 0,
       
       		right : 0,
       
       		left : 0,
       
       		borderWidth : 0,
       
       		url : "https://www.instagram.com"
       
       	});
       
       	win.add(webView);
       
       });
       
       win.open(); 
       
    3. Build and run the app on android device. 4. When the app opens and the webview is loaded log in to instagram using facebook account. 5. Log in successful and no authentication problem occurred. [Screenshot](https://i.imgsafe.org/5400a88.png) Thanks *Environment*: *Device info:* HTC One (Android 4.4.3) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  2. Lee phela 2016-04-28

    Hello, Can you run the test on google nexus device? Because I encountered the problem on google nexus 5 running android 6.0.1 Also, login has to be done via Facebook, and not Instagram issued username and password. thanks!
  3. Nazmus Salahin 2016-05-02

    Hello, I am able to reproduce this issue on Nexus7 (Android 6.0.1). Log in to Instragram using facebook account is not successful for the same code in the previous comment. The authentication process never gets completed but remain stuck forever halfway into the process. One error in console log is visible.
       [ERROR] :  TiMedia: (KrollRuntimeThread) [6748,6748] Failed to create application gallery directory.
       
    *Console Log:*
       -- Start application log -----------------------------------------------------
       [INFO] :   TiApplication: (main) [0,0] checkpoint, app created.
       [INFO] :   TiApplication: (main) [89,89] Titanium 5.2.2 (2016/03/28 14:12 b685ddb)
       [INFO] :   DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default ''
       [INFO] :   DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default ''
       [INFO] :   TiApplication: (main) [175,264] Titanium Javascript runtime: v8
       [INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
       [WARN] :   TiTempFileHelper: (main) [135,135] The external temp directory doesn't exist, skipping cleanup
       [WARN] :   V8Object: (KrollRuntimeThread) [67,202] Runtime disposed, cannot set property 'userAgent'
       [INFO] :   TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.gsl.ac3558.Ac3558webviewActivity@da47f3b
       [INFO] :   I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
       [INFO] :   OpenGLRenderer: Initialized EGL, version 1.4
       [INFO] :   WebViewFactory: Loading com.google.android.webview version 49.0.2623.105 (code 262310500)
       [INFO] :   cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 7666-7668)
       [INFO] :   cr_LibraryLoader: Expected native library version number "49.0.2623.105", actual native library version number "49.0.2623.105"
       [INFO] :   cr_LibraryLoader: Expected native library version number "49.0.2623.105", actual native library version number "49.0.2623.105"
       [INFO] :   chromium: [INFO:library_loader_hooks.cc(144)] Chromium logging enabled: level = 0, default verbosity = 0
       [INFO] :   cr_BrowserStartup: Initializing chromium process, singleProcess=true
       [WARN] :   cr_media: Requires BLUETOOTH permission
       [WARN] :   cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
       [INFO] :   Choreographer: Skipped 39 frames!  The application may be doing too much work on its main thread.
       [ERROR] :  libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
       [WARN] :   cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11389
       [INFO] :   Choreographer: Skipped 36 frames!  The application may be doing too much work on its main thread.
       [WARN] :   cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11389
       [ERROR] :  TiMedia: (KrollRuntimeThread) [6748,6748] Failed to create application gallery directory.
       [WARN] :   cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11389
       [WARN] :   cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11389
       [INFO] :   APSAnalyticsService: Analytics Service Started
       [INFO] :   APSAnalyticsService: Stopping Analytics Service
       [WARN] :   cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11389
       [WARN] :   cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 11389
       
    Thanks *Environment*: *Device info:* Nexus7 (android 6.0.1) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  4. Ashraf Abu 2016-05-09

    This is something that I wouldn't advise you to do. Having an app with a webview to sign in using Facebook is not recommended. From this link https://developers.facebook.com/blog/post/2013/06/26/october-2013-platform-changes/ {quote} The following changes will go into effect on October 2, 2013: Native iOS and Android apps must not use their own web views for Facebook Login {quote} If you need authentication, in your app, it's better that you use HttpClient to login. Or if you want to use Facebook, you could use the Facebook SDK.
  5. Ashraf Abu 2016-05-09

    [~spaceman12] If you have any other questions, feel free to comment. Resolving this ticket.
  6. Lee phela 2016-05-09

    Hello, Iam not so sure by what you mean "using http client to authenticate". The thing is, Instagram and other similar sites deeply embed Facebook within itself and as our main aim is to access the mobile web version of the Instagram, so it's not possible to use a seperate httpclient to authentic FB and take users again to the web version of Instagram all this occurring in the webview. It will be great if someone can look into this issue and get this fixed ASAP. Thank you
  7. Ashraf Abu 2016-05-10

    One way of authentication is using the Facebook SDK, https://github.com/appcelerator-modules/ti.facebook That's assuming you are making an webapp or a service that uses Facebook login. From what I understand, you want to access the mobile web version of a service that uses FB login. I'm afraid this is not the ideal way of doing so. Is there another way for you to authenticate? Getting Access Tokens from using httpclient? Cause as mentioned in the previous comment, Facebook itself says you should not use a web view for Facebook login.
  8. Ashraf Abu 2016-05-10

    Is it possible to explain what you are trying to achieve. Maybe there's a way to do this in another way.
  9. Eric Merriman 2018-08-06

    Closing as invalid. If incorrect, please reopen.

JSON Source