{"action":"created","issue":{"url":"https://api.github.com/repos/ory-am/fosite/issues/120","repository_url":"https://api.github.com/repos/ory-am/fosite","labels_url":"https://api.github.com/repos/ory-am/fosite/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/ory-am/fosite/issues/120/comments","events_url":"https://api.github.com/repos/ory-am/fosite/issues/120/events","html_url":"https://github.com/ory-am/fosite/issues/120","id":184550159,"number":120,"title":"Session expiration using JWT with 0.5.0 ExpiresAt map","user":{"login":"cristiangraz","id":169986,"avatar_url":"https://avatars.githubusercontent.com/u/169986?v=3","gravatar_id":"","url":"https://api.github.com/users/cristiangraz","html_url":"https://github.com/cristiangraz","followers_url":"https://api.github.com/users/cristiangraz/followers","following_url":"https://api.github.com/users/cristiangraz/following{/other_user}","gists_url":"https://api.github.com/users/cristiangraz/gists{/gist_id}","starred_url":"https://api.github.com/users/cristiangraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristiangraz/subscriptions","organizations_url":"https://api.github.com/users/cristiangraz/orgs","repos_url":"https://api.github.com/users/cristiangraz/repos","events_url":"https://api.github.com/users/cristiangraz/events{/privacy}","received_events_url":"https://api.github.com/users/cristiangraz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ory-am/fosite/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-21T19:21:40Z","updated_at":"2016-10-21T20:03:25Z","closed_at":null,"body":"I'm using `OAuth2JWTStrategy` for tokens. I can't seem to get the tokens to have different expirations using the new `0.5.0` release. If I configure my session like this:\r\n\r\n```go\r\ntype Session struct {\r\n   // ...\r\n   \r\n   *oauth2.JWTSession\r\n}\r\n```\r\n\r\nAnd initialize like this:\r\n```\r\nreturn &Session{\r\n    JWTSession: &oauth2.JWTSession{\r\n        JWTClaims: &jwt.JWTClaims{\r\n            Issuer:    issuer,\r\n            IssuedAt:  now,\r\n            NotBefore: now,\r\n            ExpiresAt: time.Now().Add(time.Hour * 6),\r\n            Extra:     make(map[string]interface{}),\r\n        },\r\n        ExpiresAt: map[fosite.TokenType]time.Time{\r\n            fosite.AuthorizeCode: now.Add(10 * time.Minute),\r\n            fosite.AccessToken:   now.Add(1 * time.Hour),\r\n            fosite.RefreshToken:  now.Add(2 * time.Hour),\r\n        },\r\n    },\r\n}\r\n```\r\nI expect my JWT tokens for authorize code, access token, and refresh token to have the expirations listed above. All three always are set to the `JWTClaims.ExpiresAt` time (6 hours). If I omit the `JWTClaims.ExpiresAt` field hoping for it to be set based on the `JWTSession.ExpiresAt` map, a panic is thrown.\r\n\r\nI'm able to get the authorize code to have a different expiration by doing this just before the `NewAuthorizeResponse` is created:\r\n\r\n`session.JWTClaims.ExpiresAt = session.GetExpiresAt(fosite.AuthorizeCode)`\r\n\r\nAm I misunderstanding how the new `ExpiresAt` map should work, or is it perhaps an issue with the JWT strategy?"},"comment":{"url":"https://api.github.com/repos/ory-am/fosite/issues/comments/255452668","html_url":"https://github.com/ory-am/fosite/issues/120#issuecomment-255452668","issue_url":"https://api.github.com/repos/ory-am/fosite/issues/120","id":255452668,"user":{"login":"arekkas","id":3372410,"avatar_url":"https://avatars.githubusercontent.com/u/3372410?v=3","gravatar_id":"","url":"https://api.github.com/users/arekkas","html_url":"https://github.com/arekkas","followers_url":"https://api.github.com/users/arekkas/followers","following_url":"https://api.github.com/users/arekkas/following{/other_user}","gists_url":"https://api.github.com/users/arekkas/gists{/gist_id}","starred_url":"https://api.github.com/users/arekkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arekkas/subscriptions","organizations_url":"https://api.github.com/users/arekkas/orgs","repos_url":"https://api.github.com/users/arekkas/repos","events_url":"https://api.github.com/users/arekkas/events{/privacy}","received_events_url":"https://api.github.com/users/arekkas/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T20:03:25Z","updated_at":"2016-10-21T20:03:25Z","body":"Awesome :)"}}
{"actor":{"display_login":"arekkas"}}