{"action":"created","issue":{"url":"https://api.github.com/repos/thomseddon/node-oauth2-server/issues/173","labels_url":"https://api.github.com/repos/thomseddon/node-oauth2-server/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/thomseddon/node-oauth2-server/issues/173/comments","events_url":"https://api.github.com/repos/thomseddon/node-oauth2-server/issues/173/events","html_url":"https://github.com/thomseddon/node-oauth2-server/issues/173","id":69882778,"number":173,"title":"When the access_token expired in getAccessToken","user":{"login":"arthurtalkgoal","id":7088330,"avatar_url":"https://avatars.githubusercontent.com/u/7088330?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurtalkgoal","html_url":"https://github.com/arthurtalkgoal","followers_url":"https://api.github.com/users/arthurtalkgoal/followers","following_url":"https://api.github.com/users/arthurtalkgoal/following{/other_user}","gists_url":"https://api.github.com/users/arthurtalkgoal/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurtalkgoal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurtalkgoal/subscriptions","organizations_url":"https://api.github.com/users/arthurtalkgoal/orgs","repos_url":"https://api.github.com/users/arthurtalkgoal/repos","events_url":"https://api.github.com/users/arthurtalkgoal/events{/privacy}","received_events_url":"https://api.github.com/users/arthurtalkgoal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-21T15:52:07Z","updated_at":"2015-05-10T16:29:37Z","closed_at":null,"body":"Hi, \r\nI wonder whether the ```getAccessToken``` is correct as written in ```examples/mongodb/model.js``` ( ***password and refresh_token*** grand type)\r\n\r\nThe function is simple as:\r\n```\r\nmodel.getAccessToken = function (bearerToken, callback) {\r\n  console.log('in getAccessToken (bearerToken: ' + bearerToken + ')');\r\n\r\n  OAuthAccessTokensModel.findOne({ accessToken: bearerToken }, callback);\r\n};\r\n\r\n```\r\nand there is not expiration checking. How the grant_type access_token got expired?\r\n"},"comment":{"url":"https://api.github.com/repos/thomseddon/node-oauth2-server/issues/comments/100665243","html_url":"https://github.com/thomseddon/node-oauth2-server/issues/173#issuecomment-100665243","issue_url":"https://api.github.com/repos/thomseddon/node-oauth2-server/issues/173","id":100665243,"user":{"login":"thomseddon","id":747138,"avatar_url":"https://avatars.githubusercontent.com/u/747138?v=3","gravatar_id":"","url":"https://api.github.com/users/thomseddon","html_url":"https://github.com/thomseddon","followers_url":"https://api.github.com/users/thomseddon/followers","following_url":"https://api.github.com/users/thomseddon/following{/other_user}","gists_url":"https://api.github.com/users/thomseddon/gists{/gist_id}","starred_url":"https://api.github.com/users/thomseddon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomseddon/subscriptions","organizations_url":"https://api.github.com/users/thomseddon/orgs","repos_url":"https://api.github.com/users/thomseddon/repos","events_url":"https://api.github.com/users/thomseddon/events{/privacy}","received_events_url":"https://api.github.com/users/thomseddon/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T16:29:37Z","updated_at":"2015-05-10T16:29:37Z","body":"Expiration is checked within the module it's self, you should include an `expires` key as @lvsl mentions, this will be compared against the servers current time to establish if the token has expired - if it has it will send back the correct response.\r\n\r\nHere's the relevant code for authorisation flows: https://github.com/thomseddon/node-oauth2-server/blob/master/lib/authorise.js#L110-L122"}}