{"action":"created","issue":{"url":"https://api.github.com/repos/OAuthSwift/OAuthSwift/issues/275","repository_url":"https://api.github.com/repos/OAuthSwift/OAuthSwift","labels_url":"https://api.github.com/repos/OAuthSwift/OAuthSwift/issues/275/labels{/name}","comments_url":"https://api.github.com/repos/OAuthSwift/OAuthSwift/issues/275/comments","events_url":"https://api.github.com/repos/OAuthSwift/OAuthSwift/issues/275/events","html_url":"https://github.com/OAuthSwift/OAuthSwift/issues/275","id":178170632,"number":275,"title":"\"error\" : \"invalid_client\" ","user":{"login":"ivanruizscm","id":15628215,"avatar_url":"https://avatars.githubusercontent.com/u/15628215?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanruizscm","html_url":"https://github.com/ivanruizscm","followers_url":"https://api.github.com/users/ivanruizscm/followers","following_url":"https://api.github.com/users/ivanruizscm/following{/other_user}","gists_url":"https://api.github.com/users/ivanruizscm/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanruizscm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanruizscm/subscriptions","organizations_url":"https://api.github.com/users/ivanruizscm/orgs","repos_url":"https://api.github.com/users/ivanruizscm/repos","events_url":"https://api.github.com/users/ivanruizscm/events{/privacy}","received_events_url":"https://api.github.com/users/ivanruizscm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-20T20:23:13Z","updated_at":"2016-09-20T21:38:26Z","closed_at":null,"body":" OAuthSwift (0.5.2)\r\nXcode 7.3\r\nTarget IOS8\r\nOAuth Server Google\r\n\r\nIm trying to follow [RW tutorial for OAuth2](https://www.raywenderlich.com/99431/oauth-2-with-swift-tutorial) but i can't connect, i end with this error.\r\nI also attached a Demo where its only necesary to change client key and password.\r\nNote its using swift 2.2 (xcode 7.3). \r\nThe strange thing in the tutorial is [this image](https://cdn5.raywenderlich.com/wp-content/uploads/2015/04/RW_OAuth_Tokens-571x500.png) cause in the current version of credentials the \"client secret\" doesnt appear like this, now is:\r\n<img width=\"1096\" alt=\"screen shot 2016-09-20 at 22 20 37\" src=\"https://cloud.githubusercontent.com/assets/15628215/18687485/9ebfa4ce-7f80-11e6-85ee-407a4e5dedef.png\">\r\n\r\nSo i had to go to \"create credentails\" and then click to API Key. So then i put Alza... to consumerSecret: \"\"\r\n\r\n[demo.zip](https://github.com/OAuthSwift/OAuthSwift/files/483518/demo.zip)\r\n\r\n\r\n```\r\n    let oauthswift = OAuth2Swift(consumerKey: \"****.apps.googleusercontent.com\", consumerSecret: \"****\", authorizeUrl: \"https://accounts.google.com/o/oauth2/auth\", accessTokenUrl: \"https://accounts.google.com/o/oauth2/token\", responseType: \"code\")\r\n    oauthswift.allowMissingStateCheck = true\r\n    oauthswift.authorizeWithCallbackURL(NSURL(string: \"com.raywenderlich.Incognito:/oauth2Callback\")!, scope: \"https://www.googleapis.com/auth/drive\", state: \"\", success: { (credential, response, parameters) in\r\n        print(\"granted\")\r\n      }) { (error) in\r\n        print(\"error\")\r\n    }\r\n```\r\n\r\n```\r\n(lldb) po error\r\nError Domain=NSURLErrorDomain Code=401 \"HTTP Status 401: Unauthorized, Response: {\r\n  \"error\" : \"invalid_client\"\r\n}\" UserInfo={NSLocalizedDescription=HTTP Status 401: Unauthorized, Response: {\r\n  \"error\" : \"invalid_client\"\r\n}, Response-Headers=<CFBasicHash 0x7fc4f2443ef0 [0x1033d2a40]>{type = immutable dict, count = 11,\r\nentries =>\r\n\t0 : x-content-type-options = nosniff\r\n\t1 : Content-Type = <CFString 0x7fc4f243e550 [0x1033d2a40]>{contents = \"application/json; charset=utf-8\"}\r\n\t2 : Server = GSE\r\n\t3 : Pragma = no-cache\r\n\t6 : Date = <CFString 0x7fc4f243e590 [0x1033d2a40]>{contents = \"Tue, 20 Sep 2016 20:07:17 GMT\"}\r\n\t7 : x-frame-options = <CFString 0x7fc4f2444730 [0x1033d2a40]>{contents = \"SAMEORIGIN\"}\r\n\t8 : Content-Encoding = gzip\r\n\t9 : x-xss-protection = <CFString 0x7fc4f2443cb0 [0x1033d2a40]>{contents = \"1; mode=block\"}\r\n\t10 : alt-svc = <CFString 0x7fc4f2443d90 [0x1033d2a40]>{contents = \"quic=\":443\"; ma=2592000; v=\"36,35,34,33,32\"\"}\r\n\t11 : Expires = <CFString 0x7fc4f243da30 [0x1033d2a40]>{contents = \"Mon, 01 Jan 1990 00:00:00 GMT\"}\r\n\t12 : Cache-Control = <CFString 0x7fc4f24437b0 [0x1033d2a40]>{contents = \"no-cache, no-store, max-age=0, must-revalidate\"}\r\n}\r\n, Response-Body={\r\n  \"error\" : \"invalid_client\"\r\n}}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/OAuthSwift/OAuthSwift/issues/comments/248442648","html_url":"https://github.com/OAuthSwift/OAuthSwift/issues/275#issuecomment-248442648","issue_url":"https://api.github.com/repos/OAuthSwift/OAuthSwift/issues/275","id":248442648,"user":{"login":"phimage","id":8875768,"avatar_url":"https://avatars.githubusercontent.com/u/8875768?v=3","gravatar_id":"","url":"https://api.github.com/users/phimage","html_url":"https://github.com/phimage","followers_url":"https://api.github.com/users/phimage/followers","following_url":"https://api.github.com/users/phimage/following{/other_user}","gists_url":"https://api.github.com/users/phimage/gists{/gist_id}","starred_url":"https://api.github.com/users/phimage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phimage/subscriptions","organizations_url":"https://api.github.com/users/phimage/orgs","repos_url":"https://api.github.com/users/phimage/repos","events_url":"https://api.github.com/users/phimage/events{/privacy}","received_events_url":"https://api.github.com/users/phimage/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T21:38:26Z","updated_at":"2016-09-20T21:38:26Z","body":"so that's not a real oauth flow, but some people have success to use google api according to some issues\r\n\r\nredirect uri mismatch : you don't provide the same redirect url in swift code and google configuration page\r\nmaybe only http scheme is autorized\r\n\r\nthe google doc f=\r\nhttps://developers.google.com/identity/protocols/OAuth2InstalledApp#overview\r\n\r\n\r\n"}}
{"actor":{"display_login":"phimage"}}