{"action":"opened","issue":{"url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/231","repository_url":"https://api.github.com/repos/openid/AppAuth-iOS","labels_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/231/comments","events_url":"https://api.github.com/repos/openid/AppAuth-iOS/issues/231/events","html_url":"https://github.com/openid/AppAuth-iOS/issues/231","id":315332636,"number":231,"title":"Google authentication issue on the latest macOS update","user":{"login":"andy61i","id":635819,"avatar_url":"https://avatars2.githubusercontent.com/u/635819?v=4","gravatar_id":"","url":"https://api.github.com/users/andy61i","html_url":"https://github.com/andy61i","followers_url":"https://api.github.com/users/andy61i/followers","following_url":"https://api.github.com/users/andy61i/following{/other_user}","gists_url":"https://api.github.com/users/andy61i/gists{/gist_id}","starred_url":"https://api.github.com/users/andy61i/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy61i/subscriptions","organizations_url":"https://api.github.com/users/andy61i/orgs","repos_url":"https://api.github.com/users/andy61i/repos","events_url":"https://api.github.com/users/andy61i/events{/privacy}","received_events_url":"https://api.github.com/users/andy61i/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-18T05:07:54Z","updated_at":"2018-04-18T05:07:54Z","closed_at":null,"author_association":"NONE","body":"**Setup**\r\nmacOS Sierra 10.12.6 (16G1314) OR macOS High Sierra 10.13.4 (17E199)\r\nGoogle Chrome Version 65.0.3325.181 (Official Build) (64-bit)\r\n\r\n**Pods**\r\n  - GoogleAPIClientForREST (1.3.4)\r\n  - GoogleAPIClientForREST/Core (1.3.4)\r\n  - GoogleAPIClientForREST/Drive (1.3.4)\r\n  - GoogleAPIClientForREST/Oauth2 (1.3.4)\r\n  - GTMAppAuth (0.7.0)\r\n  - GTMSessionFetcher (1.1.15)\r\n  - GTMSessionFetcher/Core (1.1.15)\r\n  - GTMSessionFetcher/Full (1.1.15)\r\n\r\n**Problem**\r\nThe following  authentication code worked well before the latest macOS update:\r\n```\r\n#define CLIENT_ID @\"382239646343-0elsgpt33tkmvod7pgdc8qbn6e9sn169.apps.googleusercontent.com\"\r\n#define CLIENT_SECRET @\"deleted\"\r\n#define REDIRECT_URI @\"com.googleusercontent.apps.382239646343-0elsgpt33tkmvod7pgdc8qbn6e9sn169:/oauthredirect\"\r\n#define DRIVE_SCOPE @\"https://www.googleapis.com/auth/drive\"\r\n\r\nOIDServiceConfiguration* configuration = [GTMAppAuthFetcherAuthorization configurationForGoogle];\r\n    OIDAuthorizationRequest *request = [[OIDAuthorizationRequest alloc] initWithConfiguration:configuration\r\n                                                                                     clientId:CLIENT_ID\r\n                                                                                 clientSecret:CLIENT_SECRET\r\n                                                                                       scopes:@[DRIVE_SCOPE]\r\n                                                                                  redirectURL:[NSURL URLWithString:REDIRECT_URI]\r\n                                                                                 responseType:OIDResponseTypeCode\r\n                                                                         additionalParameters:nil];\r\n    self.authorizationFlow = [OIDAuthState authStateByPresentingAuthorizationRequest:request\r\n                                                                            callback:^(OIDAuthState * _Nullable authState, NSError * _Nullable error) {\r\n        if (authState) {\r\n            GTMAppAuthFetcherAuthorization* authorization = [[GTMAppAuthFetcherAuthorization alloc] initWithAuthState:authState];\r\n            self.service.authorizer = authorization;\r\n            ...\r\n        } else {\r\n            self.service.authorizer = nil;\r\n            ...\r\n        }\r\n    }];\r\n```\r\n\r\nSince the update there is a problem:\r\n- Chrome starts and offer to select a Google account => Select one\r\n- Appears a page to allow access to Google Drive files => Allow\r\n- A popup appears with a query to start the app initiated this authentication\r\n\r\n<img width=\"626\" alt=\"popup\" src=\"https://user-images.githubusercontent.com/635819/38863318-e5b68bf8-423f-11e8-9743-b5a5ded9cbe8.png\">\r\n\r\nThen there are 3 possible scenarios:\r\n1. Wait a couple of seconds. The underling \"allow access page\" will automatically forwards to Google Search (as on the screen above). Then pressing \"Open SafeInCloud Password Manager\" will do nothing (the auth callback never gets called).\r\n2. Be quick and press \"Open\" button immediately. Then authentication will work.\r\n3. If the \"Always open these type of links\" checkbox was pressed in scenario 1 (on previous macOS build) or in scenario 2, then authentication will work automatically.\r\n\r\nSo, the problem is this autoforwarding from the \"allow access page\" to Google Search pages.\r\n\r\n**Testing**\r\nThe app to test problem: \r\n[https://www.safe-in-cloud.com/download/beta/SafeInCloud.dmg](https://www.safe-in-cloud.com/download/beta/SafeInCloud.dmg)\r\nSteps to reproduce:\r\n- Start the app\r\n- Select 'Restore database from a cloud'\r\n- Select 'Google Drive'\r\n"}}
{"actor":{"display_login":"andy61i"}}