{"action":"closed","issue":{"url":"https://api.github.com/repos/layerhq/layer-websdk/issues/8","repository_url":"https://api.github.com/repos/layerhq/layer-websdk","labels_url":"https://api.github.com/repos/layerhq/layer-websdk/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/layerhq/layer-websdk/issues/8/comments","events_url":"https://api.github.com/repos/layerhq/layer-websdk/issues/8/events","html_url":"https://github.com/layerhq/layer-websdk/issues/8","id":135362878,"number":8,"title":"evt.callback error","user":{"login":"EasonRen","id":8588276,"avatar_url":"https://avatars.githubusercontent.com/u/8588276?v=3","gravatar_id":"","url":"https://api.github.com/users/EasonRen","html_url":"https://github.com/EasonRen","followers_url":"https://api.github.com/users/EasonRen/followers","following_url":"https://api.github.com/users/EasonRen/following{/other_user}","gists_url":"https://api.github.com/users/EasonRen/gists{/gist_id}","starred_url":"https://api.github.com/users/EasonRen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EasonRen/subscriptions","organizations_url":"https://api.github.com/users/EasonRen/orgs","repos_url":"https://api.github.com/users/EasonRen/repos","events_url":"https://api.github.com/users/EasonRen/events{/privacy}","received_events_url":"https://api.github.com/users/EasonRen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-22T09:29:07Z","updated_at":"2016-02-26T20:23:46Z","closed_at":"2016-02-26T20:23:46Z","body":"`var layer = require('layer-websdk');\r\nvar config = require('./config.json');\r\nvar request = require('request');`\r\n\r\n`var client = new layer.Client({\r\n    appId: config.LayerAppID,\r\n    userId: config.UserID\r\n});`\r\n\r\n`function getIdentityToken(layerNonce, callback) {\r\n    \r\n    var option = {\r\n        url: config.IdentityTokenUrl,\r\n        method: \"POST\",\r\n        json: true,\r\n        headers: {\r\n            \"Content-Type\": 'application/json',\r\n        },\r\n        body: { data: { nonce: layerNonce } }\r\n    };\r\n\r\n    request(option, function (error, response, body) {\r\n        if (!error && response.statusCode == 200) {\r\n            callback(body.identity_token);\r\n        }\r\n    });\r\n} `\r\n\r\n`client.on('challenge',` function (evt) {\r\n\r\n    getIdentityToken(evt.nonce, function (identityToken) {\r\n        evt.callback(identityToken);\r\n    });\r\n});`\r\n\r\nThe last error is \"Layer-Error: 105 (invalid_property): Nonce not found or expired.\",I  can be sure of is that I can get \"body.identity_token\"."}}