{"id":16220,"date":"2014-12-04T14:42:46","date_gmt":"2014-12-04T09:12:46","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=16220"},"modified":"2016-12-19T14:54:46","modified_gmt":"2016-12-19T09:24:46","slug":"restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/","title":{"rendered":"Restricting concurrent sessions for a single user using Grails and Spring Security"},"content":{"rendered":"<p>Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users.<\/p>\n<p>You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here.<\/p>\n<p>let us see how we can allow or restrict the concurrent sessions for the different users i.e. restricting the concurrent sessions for the some users and allowing multiple sessions for a specific set of users.<\/p>\n<p>In our application, we have \u2018Executive Users\u2019 and \u2018Administrator\u2019 where the \u2018Executive Users\u2019 can not have concurrent sessions but the \u2018Administrators\u2019 can have multiple concurrent sessions i.e. they can login simultaneously from different clients\/devices with the same username.<\/p>\n<p>In order to achieve this (restriction and allowing of concurrent sessions for different sets of users), we need to do the following steps:<\/p>\n<ol>\n<li>\n<p>First off we have to extend the <span style=\"background-color: silver\"> org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy<\/span> class and override the <span style=\"background-color: silver\">getMaximumSessionsForThisUser()<\/span> method<\/p>\n<p>    [java]<br \/>\n    import org.springframework.security.core.session.SessionRegistry<br \/>\n    import org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy<\/p>\n<p>    class MyConcurrentSessionControlStrategy extends ConcurrentSessionControlStrategy {<\/p>\n<p>        MyConcurrentSessionControlStrategy(SessionRegistry sessionRegistry) {<br \/>\n            super(sessionRegistry)<br \/>\n        }<\/p>\n<p>        protected int getMaximumSessionsForThisUser(org.springframework.security.core.Authentication authentication) {<br \/>\n            Long maximumSession = 1<br \/>\n            if (Role.ROLE_ADMIN in authentication.authorities*.authority) {<br \/>\n                maximumSession = -1<br \/>\n            }<br \/>\n            return maximumSession;<br \/>\n        }<br \/>\n    }<br \/>\n    [\/java]<\/p>\n<p>    Here, we are giving infinite concurrent sessions to the users with role \u2018Administrators\u2019 whereas all the other users can have only one session. The values given to the maximumSession can be:<\/p>\n<p>    -1 for infinite session,<br \/>\n    +ve \u2018n\u2019 value for \u2018n\u2019 number of sessions allowed; the value 0 is not allowed.<\/li>\n<li>\n<p>Update resources.groovy to include your own version of ConcurrentSessionControlStrategy class i.e. MyConcurrentSessionControlStrategy:<\/p>\n<\/li>\n<\/ol>\n<p>[java]<\/p>\n<p>import org.springframework.security.core.session.SessionRegistryImpl<br \/>\nimport org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy<br \/>\nimport org.springframework.security.web.session.ConcurrentSessionFilter<\/p>\n<p>beans = {<br \/>\n    sessionRegistry(SessionRegistryImpl)<\/p>\n<p>    concurrencyFilter(ConcurrentSessionFilter) {<br \/>\n        sessionRegistry = sessionRegistry<br \/>\n        logoutHandlers = [ref(&quot;rememberMeServices&quot;), ref(&quot;securityContextLogoutHandler&quot;)]<br \/>\n        expiredUrl = &#8216;\/login\/concurrentSession&#8217;<br \/>\n    }<\/p>\n<p>    concurrentSessionControlStrategy(MyConcurrentSessionControlStrategy, sessionRegistry) {<br \/>\n        alwaysCreateSession = true<br \/>\n        exceptionIfMaximumExceeded = false<br \/>\n        maximumSessions = 1<br \/>\n    }<br \/>\n}<\/p>\n<p>[\/java]<\/p>\n<p>&nbsp;<\/p>\n<p>Lets take a look on the beans that we are injecting<\/p>\n<ol>\n<li>\n<p>sessionRegistry: We must use the SessionRegistryImpl provided by Spring security plugin.<\/p>\n<\/li>\n<li>\n<p style=\"margin: 0 0 12px\">concurrencyFilter:<\/p>\n<ol type=\"A\">\n<li>\n<p style=\"margin: 0 0 12px\">sessionRegistry: Setting sessionRegistry bean to use overridden implementation to ensure that every registered session\u2019s \u201clast updated\u201d time is always correct and check if the session is expired then call the configured logout handlers.<\/p>\n<\/li>\n<li>\n<p style=\"margin: 0 0 12px\">logoutHandlers: Updating logout handlers with rememberMeServices and securityContextLogoutHandler &#8211; By default only securityContextLogoutHandler is registered. But we also need to add rememberMeServices bean to ensure that \u201cremember me cookie\u201d is also expired if user concurrent session exceeds the maximumSession otherwise this cookie creates a new session and invalidate the other one.<\/p>\n<\/li>\n<li>\n<p>expiredUrl: This field is used to redirect the user to this url if the number of active sessions for this user exceeds the maximum allowed limit.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p style=\"margin: 0 0 12px\">concurrentSessionControlStrategy:<\/p>\n<ol type=\"A\">\n<li>\n<p style=\"margin: 0 0 12px\">alwaysCreateSession: Set the value of this field to true in order to allow concurrent sessions.<\/p>\n<\/li>\n<li>\n<p style=\"margin: 0 0 12px\">exceptionIfMaximumExceeded:<\/p>\n<ol type=\"i\">\n<li>\n<p style=\"margin: 0 0 12px\">Set it to \u201ctrue\u201d to invalidate the new session that we are creating if the concurrent sessions exceed the maximumSession.<\/p>\n<\/li>\n<li>\n<p>Set it to \u201cfalse\u201d to invalidate the oldest session that was created for the user if the concurrent sessions exceed the maximumSession.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>maximumSession: Set the maximum concurrent sessions allowed for a user.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>By doing this, Spring security will restrict the concurrent logins for the users and also ensure that users with the specific role only can have multiple sessions.<\/p>\n<p>Hope this helps !!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can [&hellip;]<\/p>\n","protected":false},"author":103,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":47,"footnotes":""},"categories":[7],"tags":[1560,4840,108,878,4841,672],"class_list":["post-16220","post","type-post","status-publish","format-standard","hentry","category-grails","tag-concurrent-session","tag-grails","tag-session","tag-login","tag-spring","tag-spring-security"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Dhanendra Kumar\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#article\",\"name\":\"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog\",\"headline\":\"Restricting concurrent sessions for a single user using Grails and Spring Security\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/dhanendra\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2014-12-04T14:42:46+05:30\",\"dateModified\":\"2016-12-19T14:54:46+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":3,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#webpage\"},\"articleSection\":\"Grails, concurrent session, Grails, HTTP session, login, Spring, spring security\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"position\":2,\"name\":\"Grails\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#listItem\",\"name\":\"Restricting concurrent sessions for a single user using Grails and Spring Security\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#listItem\",\"position\":3,\"name\":\"Restricting concurrent sessions for a single user using Grails and Spring Security\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/dhanendra\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/dhanendra\\\/\",\"name\":\"Dhanendra Kumar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4e38b1be8c8b87fecb8f9eb06a23f1bfbfd5cacc470e360119e9584489f2771b?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Dhanendra Kumar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/\",\"name\":\"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog\",\"description\":\"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/dhanendra\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/dhanendra\\\/#author\"},\"datePublished\":\"2014-12-04T14:42:46+05:30\",\"dateModified\":\"2016-12-19T14:54:46+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog","description":"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can","canonical_url":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#article","name":"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog","headline":"Restricting concurrent sessions for a single user using Grails and Spring Security","author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/dhanendra\/#author"},"publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"},"datePublished":"2014-12-04T14:42:46+05:30","dateModified":"2016-12-19T14:54:46+05:30","inLanguage":"en-US","commentCount":3,"mainEntityOfPage":{"@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#webpage"},"isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#webpage"},"articleSection":"Grails, concurrent session, Grails, HTTP session, login, Spring, spring security"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.tothenew.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/www.tothenew.com\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#listItem","name":"Restricting concurrent sessions for a single user using Grails and Spring Security"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#listItem","position":3,"name":"Restricting concurrent sessions for a single user using Grails and Spring Security","previousItem":{"@type":"ListItem","@id":"https:\/\/www.tothenew.com\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/www.tothenew.com\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/www.tothenew.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.tothenew.com\/blog\/author\/dhanendra\/#author","url":"https:\/\/www.tothenew.com\/blog\/author\/dhanendra\/","name":"Dhanendra Kumar","image":{"@type":"ImageObject","@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/4e38b1be8c8b87fecb8f9eb06a23f1bfbfd5cacc470e360119e9584489f2771b?s=96&d=mm&r=g","width":96,"height":96,"caption":"Dhanendra Kumar"}},{"@type":"WebPage","@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#webpage","url":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/","name":"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog","description":"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.tothenew.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/#breadcrumblist"},"author":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/dhanendra\/#author"},"creator":{"@id":"https:\/\/www.tothenew.com\/blog\/author\/dhanendra\/#author"},"datePublished":"2014-12-04T14:42:46+05:30","dateModified":"2016-12-19T14:54:46+05:30"},{"@type":"WebSite","@id":"https:\/\/www.tothenew.com\/blog\/#website","url":"https:\/\/www.tothenew.com\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.tothenew.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog","og:description":"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can","og:url":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/","og:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Restricting concurrent sessions for a single user using Grails and Spring Security | TO THE NEW Blog","twitter:description":"Restricting concurrent sessions for a single user is a very common requirement for any software tool which requires licensing based on number of users. You can read about how we can manage (or allow) concurrent sessions with Grails 2 using Spring security plugin in this awesome concise blog here. let us see how we can","twitter:image":"https:\/\/www.tothenew.com\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"16220","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-29 15:27:15","updated":"2024-02-29 09:26:53","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.tothenew.com\/blog\/category\/grails\/\" title=\"Grails\">Grails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRestricting concurrent sessions for a single user using Grails and Spring Security\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.tothenew.com\/blog"},{"label":"Grails","link":"https:\/\/www.tothenew.com\/blog\/category\/grails\/"},{"label":"Restricting concurrent sessions for a single user using Grails and Spring Security","link":"https:\/\/www.tothenew.com\/blog\/restricting-concurrent-sessions-for-a-single-user-using-grails-and-spring-security\/"}],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/16220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/103"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=16220"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/16220\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=16220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=16220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=16220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}