{"id":4502,"date":"2011-11-16T11:31:57","date_gmt":"2011-11-16T06:01:57","guid":{"rendered":"https:\/\/2thenew.today\/blog\/?p=4502"},"modified":"2017-04-24T15:56:04","modified_gmt":"2017-04-24T10:26:04","slug":"writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps","status":"publish","type":"post","link":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/","title":{"rendered":"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps"},"content":{"rendered":"<p>We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application.<\/p>\n<p>The spring security plugin, together with a secured controller and a custom JSON marshaller(which overrides the default functionality of render as JSON method) gave us a very simple, yet elegant and powerful JSON API which was secure. Here are the three steps that we followed<\/p>\n<p><strong>1. Setting up Spring Security Plugin: <\/strong><\/p>\n<p>The first step is to set up Spring Security Plugin to expose our JSON based controllers to use Basic Authentication, instead of the standard web-based authentication. This is done by adding the lines given below in Config.groovy<\/p>\n<p>[java]<br \/>\n\/\/Enable Basic Auth Filter<br \/>\ngrails.plugins.springsecurity.useBasicAuth = true<br \/>\ngrails.plugins.springsecurity.basic.realmName = &quot;JSON API Example&quot;<br \/>\n\/\/Exclude normal controllers from basic auth filter. Just the JSON API is included<br \/>\ngrails.plugins.springsecurity.filterChain.chainMap = [<br \/>\n&#8216;\/json\/**&#8217;: &#8216;JOINED_FILTERS,-exceptionTranslationFilter&#8217;,<br \/>\n&#8216;\/**&#8217;: &#8216;JOINED_FILTERS,-basicAuthenticationFilter,-basicExceptionTranslationFilter&#8217;<br \/>\n]<br \/>\n[\/java]<\/p>\n<p>More details about the authentication mechanism can be found here.<br \/>\n<strong>2. Adding a Controller with required actions:<\/strong><\/p>\n<p>Naturally, this is the next step. We added a controller which would expose the functionalities required(another reason why most of our logic should be in our services instead of controllers). A sample controller would look like this.<\/p>\n<p>[java]<br \/>\npackage jsonapi<br \/>\nimport grails.plugins.springsecurity.Secured<br \/>\nimport grails.converters.JSON<br \/>\nimport com.intelligrape.example.json.Book<\/p>\n<p>@Secured([&quot;ROLE_USER&quot;])<br \/>\nclass JsonController {<br \/>\n      def getBooks = {<br \/>\n          render Book.list() as JSON<br \/>\n      }<br \/>\n}<br \/>\n[\/java]<\/p>\n<p><strong>3. Customizing the Marshaller to change the way some properties like enums are rendered:<\/strong><\/p>\n<p>We had to change the way some of the properties like enums were going to be rendered. We just had to render the property name and the id of the enum. So instead of a JSON map like<\/p>\n<p>[java]<\/p>\n<p>&quot;genre&quot;:{&quot;enumType&quot;:&quot;com.intelligrape.example.json.Book$Genre&quot;,&quot;name&quot;:&quot;FICTION&quot;}<\/p>\n<p>[\/java]<\/p>\n<p>we needed<\/p>\n<p>[java]<\/p>\n<p>&quot;genre&quot;:&quot;FICTION&quot;<\/p>\n<p>[\/java]<\/p>\n<p>I sought help from David Bower&#8217;s post and created my own custom Domain Class Marshaller for JSON with a modification to just use the Enum value if the property happened to be an enum. This is a very powerful feature because it allows us to customize the way in which we want to render the values when creating a JSON or XML document from our classes. We can even customize it to have an <em>excludes <\/em>list in our domain class where we can specify the properties to be excluded while constructing our JSON or XML<\/p>\n<p>With this, we had a JSON API ready in very little time. I have extracted the functionality into a small example application, which has been shared on <a href=\"https:\/\/github.com\/svivekkrishna\/Json-API-Sample\" target=\"_blank\">Github<\/a>.<\/p>\n<p>Yet another example of how simple <a title=\"Grails and Groovy Developers \" href=\"https:\/\/2thenew.today\/grails-application-development\">grails has made it easy for developers<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":6,"footnotes":""},"categories":[7],"tags":[4840,49,226,672,682],"class_list":["post-4502","post","type-post","status-publish","format-standard","hentry","category-grails","tag-grails","tag-json","tag-rest","tag-spring-security","tag-web-services"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Vivek Krishna\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/\" \/>\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=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"article:tag\" content=\"grails\" \/>\n\t\t<meta property=\"article:tag\" content=\"json\" \/>\n\t\t<meta property=\"article:tag\" content=\"rest calls\" \/>\n\t\t<meta property=\"article:tag\" content=\"spring security\" \/>\n\t\t<meta property=\"article:tag\" content=\"web services\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2011-11-16T06:01:57+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-04-24T10:26:04+00:00\" \/>\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=\"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.today\/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\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#article\",\"name\":\"Writing JSON APIs : Part I \\u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog\",\"headline\":\"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2011-11-16T11:31:57+05:30\",\"dateModified\":\"2017-04-24T15:56:04+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#webpage\"},\"articleSection\":\"Grails, Grails, JSON, REST Calls, spring security, Web Services\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#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\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#listItem\",\"name\":\"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#listItem\",\"position\":3,\"name\":\"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps\",\"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\\\/vivek\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek\\\/\",\"name\":\"Vivek Krishna\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/07dba643a97b00215bacf46343f18d6cb7ab45f777264e13c22deb54f2cc830b?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Vivek Krishna\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/\",\"name\":\"Writing JSON APIs : Part I \\u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog\",\"description\":\"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/vivek\\\/#author\"},\"datePublished\":\"2011-11-16T11:31:57+05:30\",\"dateModified\":\"2017-04-24T15:56:04+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":"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog","description":"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a","canonical_url":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#article","name":"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog","headline":"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps","author":{"@id":"https:\/\/2thenew.today\/blog\/author\/vivek\/#author"},"publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"},"datePublished":"2011-11-16T11:31:57+05:30","dateModified":"2017-04-24T15:56:04+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#webpage"},"articleSection":"Grails, Grails, JSON, REST Calls, spring security, Web Services"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.today\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/2thenew.today\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#listItem","name":"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#listItem","position":3,"name":"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.today\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.today\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.today\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.today\/blog\/author\/vivek\/#author","url":"https:\/\/2thenew.today\/blog\/author\/vivek\/","name":"Vivek Krishna","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/07dba643a97b00215bacf46343f18d6cb7ab45f777264e13c22deb54f2cc830b?s=96&d=mm&r=g","width":96,"height":96,"caption":"Vivek Krishna"}},{"@type":"WebPage","@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#webpage","url":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/","name":"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog","description":"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.today\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.today\/blog\/author\/vivek\/#author"},"creator":{"@id":"https:\/\/2thenew.today\/blog\/author\/vivek\/#author"},"datePublished":"2011-11-16T11:31:57+05:30","dateModified":"2017-04-24T15:56:04+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.today\/blog\/#website","url":"https:\/\/2thenew.today\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.today\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"article","og:title":"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog","og:description":"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a","og:url":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/","og:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","article:tag":{"0":"grails","2":"json","3":"rest calls","4":"spring security","5":"web services"},"article:published_time":"2011-11-16T06:01:57+00:00","article:modified_time":"2017-04-24T10:26:04+00:00","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Writing JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps | TO THE NEW Blog","twitter:description":"We had a requirement in a recent project to expose some of the functionality we had via a JSON API. The functionality needed to be secure, as was the initial web interface which exposed the functionality. We were using Spring Security for the security aspect of our application. The spring security plugin, together with a","twitter:image":"https:\/\/2thenew.today\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"4502","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"article","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":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","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-30 05:41:06","updated":"2024-02-29 09:42:14","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:\/\/2thenew.today\/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:\/\/2thenew.today\/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\tWriting JSON APIs : Part I \u2013 Creating a secure JSON API with Grails and Spring Security in 3 easy steps\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.today\/blog"},{"label":"Grails","link":"https:\/\/2thenew.today\/blog\/category\/grails\/"},{"label":"Writing JSON APIs : Part I &#8211; Creating a secure JSON API with Grails and Spring Security in 3 easy steps","link":"https:\/\/2thenew.today\/blog\/writing-json-apis-part-i-creating-a-secure-rest-json-api-with-grails-and-spring-security-in-3-easy-steps\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/4502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/comments?post=4502"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/posts\/4502\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/media?parent=4502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/categories?post=4502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.today\/blog\/wp-json\/wp\/v2\/tags?post=4502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}