{"action":"created","issue":{"url":"https://api.github.com/repos/Jasig/cas/issues/1183","labels_url":"https://api.github.com/repos/Jasig/cas/issues/1183/labels{/name}","comments_url":"https://api.github.com/repos/Jasig/cas/issues/1183/comments","events_url":"https://api.github.com/repos/Jasig/cas/issues/1183/events","html_url":"https://github.com/Jasig/cas/issues/1183","id":108834377,"number":1183,"title":"different behaviour for memory ticket registry and cache based registry","user":{"login":"mduszyk","id":2797329,"avatar_url":"https://avatars.githubusercontent.com/u/2797329?v=3","gravatar_id":"","url":"https://api.github.com/users/mduszyk","html_url":"https://github.com/mduszyk","followers_url":"https://api.github.com/users/mduszyk/followers","following_url":"https://api.github.com/users/mduszyk/following{/other_user}","gists_url":"https://api.github.com/users/mduszyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mduszyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mduszyk/subscriptions","organizations_url":"https://api.github.com/users/mduszyk/orgs","repos_url":"https://api.github.com/users/mduszyk/repos","events_url":"https://api.github.com/users/mduszyk/events{/privacy}","received_events_url":"https://api.github.com/users/mduszyk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-29T09:50:46Z","updated_at":"2015-09-29T11:05:44Z","closed_at":null,"body":"v4.1.0\r\nThe problem is that when CAS is configured to use default in memory ticket registry it behaves differently than if cache based registry like hazelcast is used. The difference in behaviour is related to logout, after logout service ticket obtained before logout (tgt delete) is invalid in case of memory registry while in second situation (hazelcast) it stays valid.\r\n\r\nThe problem is that code which talks to registry relays on java references. For instance the case of generating service ticket, it pulls tgt ticket from registry (obtains reference from java hashmap), then it generates service ticket which is added to internal tgt object's map. There is no separate call to registry to update tgt ticket because it was done on the same object which is already stored there (modification via reference). Problem happens when cache based registry is used, then tgt ticket is pulled and modified, but modification is not pushed back to cache. Another problem is that service tickets are not explicitly deleted when deleting tgt ticket.\r\n\r\n  "},"comment":{"url":"https://api.github.com/repos/Jasig/cas/issues/comments/144027810","html_url":"https://github.com/Jasig/cas/issues/1183#issuecomment-144027810","issue_url":"https://api.github.com/repos/Jasig/cas/issues/1183","id":144027810,"user":{"login":"mduszyk","id":2797329,"avatar_url":"https://avatars.githubusercontent.com/u/2797329?v=3","gravatar_id":"","url":"https://api.github.com/users/mduszyk","html_url":"https://github.com/mduszyk","followers_url":"https://api.github.com/users/mduszyk/followers","following_url":"https://api.github.com/users/mduszyk/following{/other_user}","gists_url":"https://api.github.com/users/mduszyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mduszyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mduszyk/subscriptions","organizations_url":"https://api.github.com/users/mduszyk/orgs","repos_url":"https://api.github.com/users/mduszyk/repos","events_url":"https://api.github.com/users/mduszyk/events{/privacy}","received_events_url":"https://api.github.com/users/mduszyk/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T11:05:44Z","updated_at":"2015-09-29T11:05:44Z","body":"But even if I activate registry cleaner, it will be doing cleanups at some rate. This means that the delay between clean-ups will be the time it is possible to have the state where ST ticket is valid after TGT was deleted. This will never happen in case of memory registry because TGT delete action makes it go into the state where ST in invalid instantly.\r\n\r\nSecond, look at this line:\r\nhttps://github.com/mduszyk/cas/commit/3d1ea75b001b57b3694596cd891f54fe91e53b64#diff-c40a1eb262f1360be5db8cc1f1ddfc59R331\r\nhere ST ticket is generated and added to TGT but this change never persists (only local object is modified - not data stored in cache), while the same code works when memory registry is used because this change is persisted in memory.\r\n\r\nSo even if I use ticket registry cleaner, make it clean quite often, I will still face second issue with cache based registry where ST map change won't be saved on TGT object."}}