{"action":"created","issue":{"url":"https://api.github.com/repos/delba/SwiftyOAuth/issues/10","repository_url":"https://api.github.com/repos/delba/SwiftyOAuth","labels_url":"https://api.github.com/repos/delba/SwiftyOAuth/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/delba/SwiftyOAuth/issues/10/comments","events_url":"https://api.github.com/repos/delba/SwiftyOAuth/issues/10/events","html_url":"https://github.com/delba/SwiftyOAuth/issues/10","id":159763476,"number":10,"title":"Authentication with Google: not matching redirect URL","user":{"login":"fabiomassimo","id":2462167,"avatar_url":"https://avatars.githubusercontent.com/u/2462167?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiomassimo","html_url":"https://github.com/fabiomassimo","followers_url":"https://api.github.com/users/fabiomassimo/followers","following_url":"https://api.github.com/users/fabiomassimo/following{/other_user}","gists_url":"https://api.github.com/users/fabiomassimo/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiomassimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiomassimo/subscriptions","organizations_url":"https://api.github.com/users/fabiomassimo/orgs","repos_url":"https://api.github.com/users/fabiomassimo/repos","events_url":"https://api.github.com/users/fabiomassimo/events{/privacy}","received_events_url":"https://api.github.com/users/fabiomassimo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-11T08:44:05Z","updated_at":"2016-06-11T10:28:07Z","closed_at":null,"body":"I was trying to perform a login with Google Service.\r\n\r\nHereby the executed code\r\n\r\n```swift\r\n\r\nlet provider = Provider.Google(clientID: \"$(the_client_id)\", clientSecret: \"$(the_client_secret)\", redirectURL: \"$(bundle_identifier):/urn:ietf:wg:oauth:2.0:oob\")\r\n\r\nprovider.scopes = [\"https://www.googleapis.com/auth/analytics.readonly\"]\r\n        \r\nprovider.authorize(self) { (result) in\r\n    switch result {\r\n    case .Success(let token):\r\n        print(token)\r\n    case .Failure(let error):\r\n        print(error)\r\n}\r\n```\r\n\r\nWhen the authorisation is granted in the Safari View Controller the redirect URL gets triggered with following format:\r\n\r\n```\r\n$(bundle_identifier):/urn:ietf:wg:oauth:2.0:oob?code=$(the_authorization_code)\r\n```\r\n\r\nThis cause an issue for when the library checks if the redirect URL use during the initialisation of the Provider matches the received redirect URL from the `AppDelegate`.\r\n\r\nI've tried other combination of redirect URL but that's the redirect URL format that the Google guide advocates.\r\n\r\nDid anyone experienced this when trying the built in Google Provider?\r\n\r\nI think an easy fix would be to match the retrieved URL by removing and GET parameter from the URL but before open a new PR I'd like to receive some feedback about this."},"comment":{"url":"https://api.github.com/repos/delba/SwiftyOAuth/issues/comments/225350698","html_url":"https://github.com/delba/SwiftyOAuth/issues/10#issuecomment-225350698","issue_url":"https://api.github.com/repos/delba/SwiftyOAuth/issues/10","id":225350698,"user":{"login":"fabiomassimo","id":2462167,"avatar_url":"https://avatars.githubusercontent.com/u/2462167?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiomassimo","html_url":"https://github.com/fabiomassimo","followers_url":"https://api.github.com/users/fabiomassimo/followers","following_url":"https://api.github.com/users/fabiomassimo/following{/other_user}","gists_url":"https://api.github.com/users/fabiomassimo/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiomassimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiomassimo/subscriptions","organizations_url":"https://api.github.com/users/fabiomassimo/orgs","repos_url":"https://api.github.com/users/fabiomassimo/repos","events_url":"https://api.github.com/users/fabiomassimo/events{/privacy}","received_events_url":"https://api.github.com/users/fabiomassimo/received_events","type":"User","site_admin":false},"created_at":"2016-06-11T10:28:07Z","updated_at":"2016-06-11T10:28:07Z","body":"> Removing what?\r\n\r\nThe `?code=$(the_authorization_code)` at the end of the URL which makes it different from the redirect URL used to initialise the provider."}}
{"actor":{"display_login":"fabiomassimo"}}