{ "id": "167532", "key": "AC-4955", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-05-10T11:22:09.000+0000", "created": "2017-05-09T23:55:49.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-10T13:28:28.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I am using the OAuth feature of Google to authenticate users. Authorization page opens with a 403 error with the description:\r\n\r\nThis user-agent is not permitted to make OAuth authorization request to Google as it is classified as an embedded user-agent (also known as a web-view). Per our policy, only browsers are permitted to make authorization requests to Google. We offer several libraries and samples for native apps to perform authorization request in browser.\r\n\r\nGoogle url is opened within web view. \r\n\r\nCode Snippet:\r\n\r\n$.webview.url = args.url;//for new oAuth\r\nfunction webviewLoaded(e){\r\n\t//wait for result to be put on webview by backend:\r\n var result = $.webview.evalJS('result');\r\n console.log(\"Social Login Results ---\" + result);\r\n //when get the result, call the return function in index.js and return the result:\r\n if(result){\r\n \targs.loginReturned(result);\r\n \t$.socialLogin.close();\r\n }\r\n}", "attachment": [ { "id": "62199", "filename": "GoogleErrorWEbView.png", "author": { "name": "mr.jatinjoshi.mca@gmail.com", "key": "mr.jatinjoshi.mca@gmail.com", "displayName": "JATIN JOSHI", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-09T23:54:51.000+0000", "size": 209301, "mimeType": "image/png" } ], "flagged": false, "summary": "Webview Google OAuth Issue", "creator": { "name": "mr.jatinjoshi.mca@gmail.com", "key": "mr.jatinjoshi.mca@gmail.com", "displayName": "JATIN JOSHI", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mr.jatinjoshi.mca@gmail.com", "key": "mr.jatinjoshi.mca@gmail.com", "displayName": "JATIN JOSHI", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "419457", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Here are your options (this is no Titanium issue):\r\n- Use the [Ti.GoogleSignIn|https://github.com/hansemannn/titanium-google-signin] module to do the OAuth flow with their native library\r\n- Use the Safari-Browser via {{Ti.Platform.openURL}} to handle the URL and set the callback url-scheme to your app's URL scheme (e.g. {{myapp://}}\r\n\r\nWebViews in general are disallowed by Google, that's what the message also says. I hope one of the above suggestions will help.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-10T11:22:05.000+0000", "updated": "2017-05-10T11:22:05.000+0000" }, { "id": "419464", "author": { "name": "mr.jatinjoshi.mca@gmail.com", "key": "mr.jatinjoshi.mca@gmail.com", "displayName": "JATIN JOSHI", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried this:\r\n\r\nsafariDialog.open({\r\n\t\turl: args.url,\r\n\t\ttintColor:\"red\"\r\n\t});\r\n\t\r\nTi.App.iOS.addEventListener(\"handleurl\", function(e) {\r\n // If the handled url is provided by the safari-dialog, close it (use-case for OAuth)\r\n console.log(\"RESPONSE FROM SERVER\" + JSON.stringify(e));\r\n if (e.launchOptions.source == \"com.apple.SafariViewService\") {\r\n safari.close();\r\n }\r\n});\r\n\r\nBut not getting any response.", "updateAuthor": { "name": "mr.jatinjoshi.mca@gmail.com", "key": "mr.jatinjoshi.mca@gmail.com", "displayName": "JATIN JOSHI", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-10T13:28:28.000+0000", "updated": "2017-05-10T13:28:28.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }