{ "id": "128794", "key": "AC-1301", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-04-17T06:14:21.000+0000", "created": "2014-04-08T13:14:47.000+0000", "labels": [ "SSO", "android", "facebook" ], "versions": [], "issuelinks": [], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:42.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14550", "name": "Appcelerator Modules", "description": "Please enter tickets related to Modules here." } ], "description": "I am building an app for iOS and Android. To login to Facebook I'm using the Titanium Module. In iOS, all forms of Facebook login works fine. In Android, when I execute the fb.authorize() for the first time, the log in event from Facebook is fired with no problem at all. But if I log out and then try to authorize again(at this point my app's permissions have been already accepted so in theory it should fire the login event) I get the following error on logcat:\r\n\r\n[ERROR] : FacebookModule: (main) [32951,33668] LoginDialogListener onFacebookError: Invalid access token.\r\n[ERROR] : FacebookModule: com.facebook.android.FacebookError: Invalid access token.\r\n[ERROR] : FacebookModule: \tat com.facebook.android.Facebook.onSessionCallback(Facebook.java:433)\r\n[ERROR] : FacebookModule: \tat com.facebook.android.Facebook.access$000(Facebook.java:97)\r\n[ERROR] : FacebookModule: \tat com.facebook.android.Facebook$2.call(Facebook.java:379)\r\n[ERROR] : FacebookModule: \tat com.facebook.Session$3$1.run(Session.java:1239)\r\n[ERROR] : FacebookModule: \tat android.os.Handler.handleCallback(Handler.java:615)\r\n[ERROR] : FacebookModule: \tat android.os.Handler.dispatchMessage(Handler.java:92)\r\n[ERROR] : FacebookModule: \tat android.os.Looper.loop(Looper.java:153)\r\n[ERROR] : FacebookModule: \tat android.app.ActivityThread.main(ActivityThread.java:5042)\r\n[ERROR] : FacebookModule: \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n[ERROR] : FacebookModule: \tat java.lang.reflect.Method.invoke(Method.java:511)\r\n[ERROR] : FacebookModule: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821)\r\n[ERROR] : FacebookModule: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)\r\n[ERROR] : FacebookModule: \tat dalvik.system.NativeStart.main(Native Method)\r\n[ERROR] : FacebookModule: (main) [108,33776] onAuthFail: Invalid access token.\r\n\r\n\r\n\r\nif I manually remove the app permissions in the test users profile, I can again call fb.authorize() successfully and trigger the fb.login event. but again after logout, same problem raises.", "attachment": [ { "id": "47191", "filename": "Test-FB-SSO-Android.zip", "author": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T22:16:39.000+0000", "size": 2464656, "mimeType": "application/zip" } ], "flagged": false, "summary": "SSO for facebook does not work on Android", "creator": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 3.2.1.201402041146\r\nTitanium SDK 3.2.2GA\r\nAndroid API 4.1\r\nFacebook module 3.0.2 (latest)", "comment": { "comments": [ { "id": "300232", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue seems to be a duplicate of TIMODOPEN-377. Can you please confirm? If not, we need a simple runnable test case to reproduce this issue.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T17:31:31.000+0000", "updated": "2014-04-08T17:31:31.000+0000" }, { "id": "300306", "author": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Ritu,\nNo, this is not the same problem as TIMODOPEN-377. The other case is an issue experienced in iOS. with this ticket, iOS works fine; Running the app in Android generate the issue I explained above.\n\nHow to reproduce:\n\n1. Import the test project uploaded for this case (TEst-FB-SSO-Android.zip) - update the facebook app id in the tiapp.xml and applicationwindow.js\n2. Run the project and install the app in an Android device (I have tested API 4.1) - please note, you need to have the FB app installed as this problem is related to SSO (normal sign in with Facebook works fine)\n3. Click on the facebook login button. If you have previously authorized the user in the nominated facebook app, you'll see the above error straight away. but if you've never authorized the test user with the nominated app for the set permissions, you'll be able to login successfully once. When you logout and try to login again, you'll see the above error.\n\nLet me know if you have any question.\n\nRegards,\nArman", "updateAuthor": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T22:26:05.000+0000", "updated": "2014-04-08T22:26:05.000+0000" }, { "id": "300402", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for the test case. I noticed that you are setting fb.forceDialogAuth = false;\n\nCan you please try commenting it out and see if you are able to login successfully after logging out from Facebook?\n\nRelated Q&A topic: https://developer.appcelerator.com/question/141517/titaniumfacebookforcedialogauth-not-reopening-my-app", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-09T19:00:22.000+0000", "updated": "2014-04-09T19:00:22.000+0000" }, { "id": "300442", "author": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Ritu,\n\nThe default value of fb.forceDialogAuth is TRUE which means If I dont set the value to false, it will not do SSO. As mentioned above, if I dont use SSO, everything works fine. But I need to implement SSO (which is done by setting the value of fb.forceDialogAuth to TRUE); the SSO works fine with iOS and according to the documentations it should also works fine with Android which is not the case here. When I set the value of fb.forceDialogAuth to FALSE to force SSO, I get the above error on Android.\n\nWhere you able to reproduce the issue?\n\nThanks\nArman", "updateAuthor": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-09T22:19:09.000+0000", "updated": "2014-04-09T22:19:09.000+0000" }, { "id": "300476", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have not been able to reproduce this error or issue with this test case or Kitchen Sink example. Setting fb.forceDialogAuth to False works fine for me on Samsung Galaxy device. Can you try KitchenSink example with this property set to False and see if you can reproduce this issue?\n\nKitchenSink => MASHUPS => Facebook => Login/Logout", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-10T05:55:22.000+0000", "updated": "2014-04-10T05:55:22.000+0000" }, { "id": "300653", "author": { "name": "deepakpardeshi", "key": "deepakpardeshi", "displayName": "deepakpardeshi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi i am also facing same issue on my android project. SSO keeping fb.forceDialogAuth to Fasle.Only first time when fb app is not authorised i can able to log in, after wards i can not log in get following error. \n\nFacebookModule: (main) [5164,192826] LoginDialogListener onFacebookError: Invalid access token.\n[ERROR] : FacebookModule: com.facebook.android.FacebookError: Invalid access token.\n[ERROR] : FacebookModule: \tat com.facebook.android.Facebook.onSessionCallback(Facebook.java:433)\n[ERROR] : FacebookModule: \tat com.facebook.android.Facebook.access$000(Facebook.java:97)\n[ERROR] : FacebookModule: \tat com.facebook.android.Facebook$2.call(Facebook.java:379)\n[ERROR] : FacebookModule: \tat com.facebook.Session$3$1.run(Session.java:1239)\n[ERROR] : FacebookModule: \tat android.os.Handler.handleCallback(Handler.java:615)\n[ERROR] : FacebookModule: \tat android.os.Handler.dispatchMessage(Handler.java:92)\n[ERROR] : FacebookModule: \tat android.os.Looper.loop(Looper.java:137)\n[ERROR] : FacebookModule: \tat android.app.ActivityThread.main(ActivityThread.java:4960)\n[ERROR] : FacebookModule: \tat java.lang.reflect.Method.invokeNative(Native Method)\n[ERROR] : FacebookModule: \tat java.lang.reflect.Method.invoke(Method.java:511)\n[ERROR] : FacebookModule: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)\n[ERROR] : FacebookModule: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)\n[ERROR] : FacebookModule: \tat dalvik.system.NativeStart.main(Native Method)\n[ERROR] : FacebookModule: (main) [4,192830] onAuthFail: Invalid access token.", "updateAuthor": { "name": "deepakpardeshi", "key": "deepakpardeshi", "displayName": "deepakpardeshi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-11T11:24:50.000+0000", "updated": "2014-04-11T11:24:50.000+0000" }, { "id": "300654", "author": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For me the problem was my hash key (which you have to enter in the configuration of your facebook app). I finally managed to generate the correct dev hash key using the following command:\n\nkeytool -exportcert -alias tidev -keystore ~/Library/\"Application Support\"/Titanium/mobilesdk/osx/3.2.2.GA/android/dev_keystore -s torepass tirocks | openssl sha1 -binary | openssl base64\n\n\nRitu, Thank you for your help. I dont experience this issue anymore.\n", "updateAuthor": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-11T11:41:08.000+0000", "updated": "2014-04-11T11:41:08.000+0000" }, { "id": "300655", "author": { "name": "deepakpardeshi", "key": "deepakpardeshi", "displayName": "deepakpardeshi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi arman i created hash key using above command but still getting same error can you please help me.\nwhat is -storepass tirocks in above command didn't get that. ", "updateAuthor": { "name": "deepakpardeshi", "key": "deepakpardeshi", "displayName": "deepakpardeshi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-11T12:53:08.000+0000", "updated": "2014-04-11T12:53:08.000+0000" }, { "id": "300656", "author": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have no idea about the components of the command. What password did you enter? you must enter 'android'", "updateAuthor": { "name": "arman", "key": "arman", "displayName": "Arman Masoudi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-11T13:13:44.000+0000", "updated": "2014-04-11T13:13:44.000+0000" }, { "id": "301213", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Resolving this ticket as the reporter confirmed that it was an issue with his hash key.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-17T06:14:21.000+0000", "updated": "2014-04-17T06:14:21.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }