{"action":"created","issue":{"url":"https://api.github.com/repos/jwtk/jjwt/issues/74","labels_url":"https://api.github.com/repos/jwtk/jjwt/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/jwtk/jjwt/issues/74/comments","events_url":"https://api.github.com/repos/jwtk/jjwt/issues/74/events","html_url":"https://github.com/jwtk/jjwt/pull/74","id":122810670,"number":74,"title":"Expiration extension for parser","user":{"login":"strokine","id":1211041,"avatar_url":"https://avatars.githubusercontent.com/u/1211041?v=3","gravatar_id":"","url":"https://api.github.com/users/strokine","html_url":"https://github.com/strokine","followers_url":"https://api.github.com/users/strokine/followers","following_url":"https://api.github.com/users/strokine/following{/other_user}","gists_url":"https://api.github.com/users/strokine/gists{/gist_id}","starred_url":"https://api.github.com/users/strokine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strokine/subscriptions","organizations_url":"https://api.github.com/users/strokine/orgs","repos_url":"https://api.github.com/users/strokine/repos","events_url":"https://api.github.com/users/strokine/events{/privacy}","received_events_url":"https://api.github.com/users/strokine/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-17T19:53:24Z","updated_at":"2015-12-17T21:31:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jwtk/jjwt/pulls/74","html_url":"https://github.com/jwtk/jjwt/pull/74","diff_url":"https://github.com/jwtk/jjwt/pull/74.diff","patch_url":"https://github.com/jwtk/jjwt/pull/74.patch"},"body":"In some cases I need to accept even expired token.\r\nI've added a setting to the parser:\r\n```\r\nJwts.parser().setExpirationExtension(2000).parse(compact)\r\n```\r\nwhich would extend the expiration time by the provided value (in milliseconds).\r\n\r\nIf you like the feature and accept the pull request, it would help us continue to use the official release instead of our fork.\r\n\r\nThank you,\r\nEugene\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jwtk/jjwt/issues/comments/165587912","html_url":"https://github.com/jwtk/jjwt/pull/74#issuecomment-165587912","issue_url":"https://api.github.com/repos/jwtk/jjwt/issues/74","id":165587912,"user":{"login":"strokine","id":1211041,"avatar_url":"https://avatars.githubusercontent.com/u/1211041?v=3","gravatar_id":"","url":"https://api.github.com/users/strokine","html_url":"https://github.com/strokine","followers_url":"https://api.github.com/users/strokine/followers","following_url":"https://api.github.com/users/strokine/following{/other_user}","gists_url":"https://api.github.com/users/strokine/gists{/gist_id}","starred_url":"https://api.github.com/users/strokine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strokine/subscriptions","organizations_url":"https://api.github.com/users/strokine/orgs","repos_url":"https://api.github.com/users/strokine/repos","events_url":"https://api.github.com/users/strokine/events{/privacy}","received_events_url":"https://api.github.com/users/strokine/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T21:31:40Z","updated_at":"2015-12-17T21:31:40Z","body":"If I understand the idea of clock drift correctly, it adds some space to two check points:\r\n1. premature token exception would be thrown only if the **currentTime + driftTimeMillis < tokenIssueTime**\r\n2. expired token exception would be thrown only if the **currentTime - driftTimeMillis > tokenExpirationTime**\r\n\r\nSo, expirationTimeMillis would be applied only to case 2, like this: **currentTime - driftTimeMillis > tokenExpirationTime+expirationTimeMillis**\r\nSo both properties are needed, because they are serving different cases, and even if expirationTimeMillis is set, the premature token exception wouldn't be affected.\r\n\r\nUnfortunately I don't have time today to add one more feature for the driftTimeMillis, but if I'll have it tomorrow, I'll update this PR or will create a new one. But even without driftTimeMillis feature, expirationTimeMillis still have right to exist.\r\n"}}