{"action":"opened","issue":{"url":"https://api.github.com/repos/wstrange/GoogleAuth/issues/50","repository_url":"https://api.github.com/repos/wstrange/GoogleAuth","labels_url":"https://api.github.com/repos/wstrange/GoogleAuth/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/wstrange/GoogleAuth/issues/50/comments","events_url":"https://api.github.com/repos/wstrange/GoogleAuth/issues/50/events","html_url":"https://github.com/wstrange/GoogleAuth/issues/50","id":189651336,"number":50,"title":"Doesn't work for some reason","user":{"login":"prostovasya","id":23497005,"avatar_url":"https://avatars.githubusercontent.com/u/23497005?v=3","gravatar_id":"","url":"https://api.github.com/users/prostovasya","html_url":"https://github.com/prostovasya","followers_url":"https://api.github.com/users/prostovasya/followers","following_url":"https://api.github.com/users/prostovasya/following{/other_user}","gists_url":"https://api.github.com/users/prostovasya/gists{/gist_id}","starred_url":"https://api.github.com/users/prostovasya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prostovasya/subscriptions","organizations_url":"https://api.github.com/users/prostovasya/orgs","repos_url":"https://api.github.com/users/prostovasya/repos","events_url":"https://api.github.com/users/prostovasya/events{/privacy}","received_events_url":"https://api.github.com/users/prostovasya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-16T09:59:31Z","updated_at":"2016-11-16T09:59:31Z","closed_at":null,"body":"Hi\r\nTried to implement this code to my project, but all the times the verification code was invalid. I used a\r\nGoogleAuthenticatorConfigBuilder instance with the different settings (digits, windows, key representations), but always failure.\r\n\r\nI use your code with Google Authenticator.  I don't know. May be there are a special settings for it ?\r\nCan you help me ?\r\n\r\nBy default I use code bellow.\r\n1. Here is creation user's creditians\r\n\r\n```\r\n      val builder = new GoogleAuthenticatorConfigBuilder()\r\n      val gAuth = new GoogleAuthenticator(builder.build())\r\n      gAuth.setCredentialRepository(new CreditRepository)\r\n\r\n      val creditiands = gAuth.createCredentials(\"sa\")\r\n      val otpAuthURL = GoogleAuthenticatorQRGenerator.getOtpAuthURL(\"SomeSite\", \"sa\", creditiands)\r\n```\r\nAs CreditRepository I just used a something like a Mock object:\r\n\r\n```\r\nclass CreditRepository extends ICredentialRepository{ \r\n  override def getSecretKey(userName: String): String = {\r\n    return \"KR52HV2U5Z4DWGLJ\"\r\n  }\r\n  override def saveUserCredentials(\r\n                            userName: String, \r\n                            secretKey: String, \r\n                            validationCode: Int, \r\n                            scratchCodes: util.List[Integer]): Unit = { }\r\n}\r\n```\r\n\r\n2. Here is a checking: \r\n\r\n```\r\n      var builder = new GoogleAuthenticatorConfigBuilder()\r\n      var gAuth = new GoogleAuthenticator(builder.build())\r\n      gAuth.setCredentialRepository(new CreditRepository)\r\n\r\n      val isCodeValid =  gAuth.authorizeUser(\"sa\", <verificationCode>)\r\n```\r\n"}}
{"actor":{"display_login":"prostovasya"}}