{"id":56744,"date":"2016-05-30T22:00:48","date_gmt":"2016-05-30T19:00:48","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=56744"},"modified":"2016-05-29T19:04:17","modified_gmt":"2016-05-29T16:04:17","slug":"validating-jwt-spring-boot-spring-security","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html","title":{"rendered":"Validating JWT with Spring Boot and Spring Security"},"content":{"rendered":"<p>For my current project I will have a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Representational_state_transfer\">REST API<\/a> set up with <a href=\"http:\/\/projects.spring.io\/spring-boot\/\">Spring Boot<\/a> (most likely running with <a href=\"https:\/\/boxfuse.com\/\">BoxFuse<\/a>). To be able to use the API endpoint the application will check that the incoming request has a valid <a href=\"https:\/\/jwt.io\/\">JWT token<\/a> provided earlier (by an API service that I trust).<br \/>\nTo implement this functionality I want to make use of <a href=\"http:\/\/projects.spring.io\/spring-security\/\">Spring Security<\/a> as it fits nicely with Spring Boot. When googling for information about this combination I ran into <a href=\"https:\/\/www.toptal.com\/java\/rest-security-with-jwt-spring-security-and-java\">this site<\/a> that describes the background information quite nicely but didn\u2019t give me all the necessary sources to get it running. So after some more investigating and trial &amp; error I finally came to a working solution. Note that in my situation I only needed to validate an incoming token, I don\u2019t need to create or supply new tokens.<\/p>\n<p>The source code of the example can be found <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\">here<\/a> on GitLab. The example application has a REST Controller called <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\/blob\/master\/src\/main\/java\/nl\/palmapps\/myawesomeproject\/controller\/MainController.java\">MainController<\/a>. After starting the application (by running the <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\/blob\/master\/src\/main\/java\/nl\/palmapps\/myawesomeproject\/controller\/MainController.java\">Application<\/a>.main method) you can access the REST endpoint with: <a href=\"http:\/\/localhost:8888\/hello?name=PalmApps\">http:\/\/localhost:8888\/hello?name=PalmApps<\/a>. As you will see you will get a HTTP 401 error if you try this in your browser:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><a href=\"https:\/\/pragmaticintegrator.wordpress.com\/2016\/05\/27\/validating-jwt-with-spring-boot-and-spring-security\/screenshot-at-may-27-16-16-34\/\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-56778\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-16-34.png\" alt=\"screenshot-at-may-27-16-16-34\" width=\"640\" height=\"271\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-16-34.png 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-16-34-300x127.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>To get access to the endpoint you will need to supply a JWT token so you can get through the <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\/blob\/master\/src\/main\/java\/nl\/palmapps\/myawesomeproject\/security\/JwtAuthenticationTokenFilter.java\">JwtAuthenticationFilter<\/a>. To generate a valid token open the sources of the class <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\/blob\/master\/src\/main\/java\/nl\/palmapps\/myawesomeproject\/security\/util\/JwtTokenGenerator.java\">JwtTokenGenerator<\/a> and run the \u2018main\u2019 method, which will print a token in the console:<\/p>\n<p><a href=\"https:\/\/pragmaticintegrator.wordpress.com\/2016\/05\/27\/validating-jwt-with-spring-boot-and-spring-security\/screenshot-at-may-27-16-25-02\/\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-56779\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-25-02.png\" alt=\"screenshot-at-may-27-16-25-02\" width=\"640\" height=\"507\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-25-02.png 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-25-02-300x238.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Copy the token and open a tool with which you can send a HTTP request and add the token to the header like <a href=\"https:\/\/www.getpostman.com\/\">Postman<\/a>:<\/p>\n<p><a href=\"https:\/\/pragmaticintegrator.wordpress.com\/2016\/05\/27\/validating-jwt-with-spring-boot-and-spring-security\/screenshot-at-may-27-16-28-09\/\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-56780\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-28-09.png\" alt=\"screenshot-at-may-27-16-28-09\" width=\"640\" height=\"318\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-28-09.png 640w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/screenshot-at-may-27-16-28-09-300x149.png 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>With the token in place you will see the expected output:<\/p>\n<pre class=\"brush:bash\">{\r\n  \"id\": 2,\r\n  \"content\": \"Hello, PalmApps!\"\r\n}<\/pre>\n<p>If you access the endpoint <a href=\"http:\/\/localhost:8888\/me\">http:\/\/localhost:8888\/me<\/a> with a POST request (still with the \u2018Authorization\u2019 header in place) you will get the details of the Principal object in JSON format:<\/p>\n<pre class=\"brush:bash\">{\r\n  \"details\": null,\r\n  \"authorities\": [\r\n    {\r\n      \"authority\": \"admin\"\r\n    }\r\n  ],\r\n  \"authenticated\": true,\r\n  \"principal\": {\r\n    \"username\": \"Pascal\",\r\n    \"token\": \"eyJhbGciOiJIUzUxMeJ9.eyJzdwIiOi....m72LpFADA\",\r\n    \"authorities\": [\r\n      {\r\n        \"authority\": \"admin\"\r\n      }\r\n    ],\r\n    \"password\": null\r\n  },\r\n  \"credentials\": null,\r\n  \"name\": \"Pascal\"\r\n}<\/pre>\n<p>The \u2018principal\u2019 field in the returned object here is our <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\/blob\/master\/src\/main\/java\/nl\/palmapps\/myawesomeproject\/security\/model\/AuthenticatedUser.java\">AuthenticatedUser<\/a>. If we get want to get more information from our JWT then we can simply add it to this object and fill it in the <a href=\"https:\/\/gitlab.com\/palmapps\/jwt-spring-security-demo\/blob\/master\/src\/main\/java\/nl\/palmapps\/myawesomeproject\/security\/JwtAuthenticationProvider.java\">JwtAuthenticationProvider<\/a>.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"https:\/\/pragmaticintegrator.wordpress.com\/2016\/05\/27\/validating-jwt-with-spring-boot-and-spring-security\/\">Validating JWT with Spring Boot and Spring Security<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Pascal Alma at the <a href=\"http:\/\/pragmaticintegrator.wordpress.com\/\">The Pragmatic Integrator<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the application will check that the incoming request has a valid JWT token provided earlier (by an API service that I trust). To implement this functionality I &hellip;<\/p>\n","protected":false},"author":366,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1289,30,854,125],"class_list":["post-56744","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jwt","tag-spring","tag-spring-boot","tag-spring-security"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Validating JWT with Spring Boot and Spring Security - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Validating JWT with Spring Boot and Spring Security - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-30T19:00:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Pascal Alma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/paskal_1973\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pascal Alma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html\"},\"author\":{\"name\":\"Pascal Alma\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/a4c0bb5bfa87eb00be92c7a1d293fecf\"},\"headline\":\"Validating JWT with Spring Boot and Spring Security\",\"datePublished\":\"2016-05-30T19:00:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html\"},\"wordCount\":378,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"JWT\",\"Spring\",\"Spring Boot\",\"Spring Security\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html\",\"name\":\"Validating JWT with Spring Boot and Spring Security - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2016-05-30T19:00:48+00:00\",\"description\":\"For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/05\\\/validating-jwt-spring-boot-spring-security.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Validating JWT with Spring Boot and Spring Security\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/a4c0bb5bfa87eb00be92c7a1d293fecf\",\"name\":\"Pascal Alma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/53ba6f041ccc86b6efd6278d4bcffecc424dc8eeaca5593acab22ae19748f5cb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/53ba6f041ccc86b6efd6278d4bcffecc424dc8eeaca5593acab22ae19748f5cb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/53ba6f041ccc86b6efd6278d4bcffecc424dc8eeaca5593acab22ae19748f5cb?s=96&d=mm&r=g\",\"caption\":\"Pascal Alma\"},\"description\":\"Pascal is a senior JEE Developer and Architect at 4Synergy in The Netherlands. Pascal has been designing and building J2EE applications since 2001. He is particularly interested in Open Source toolstack (Mule, Spring Framework, JBoss) and technologies like Web Services, SOA and Cloud technologies. Specialties: JEE, SOA, Mule ESB, Maven, Cloud Technology, Amazon AWS.\",\"sameAs\":[\"http:\\\/\\\/pragmaticintegrator.wordpress.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/pascalalma\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/paskal_1973\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/pascal-alma\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Validating JWT with Spring Boot and Spring Security - Java Code Geeks","description":"For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html","og_locale":"en_US","og_type":"article","og_title":"Validating JWT with Spring Boot and Spring Security - Java Code Geeks","og_description":"For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the","og_url":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-05-30T19:00:48+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Pascal Alma","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/paskal_1973","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Pascal Alma","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html"},"author":{"name":"Pascal Alma","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/a4c0bb5bfa87eb00be92c7a1d293fecf"},"headline":"Validating JWT with Spring Boot and Spring Security","datePublished":"2016-05-30T19:00:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html"},"wordCount":378,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["JWT","Spring","Spring Boot","Spring Security"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html","url":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html","name":"Validating JWT with Spring Boot and Spring Security - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2016-05-30T19:00:48+00:00","description":"For my current project I will have a REST API set up with Spring Boot (most likely running with BoxFuse). To be able to use the API endpoint the","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/05\/validating-jwt-spring-boot-spring-security.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Validating JWT with Spring Boot and Spring Security"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/a4c0bb5bfa87eb00be92c7a1d293fecf","name":"Pascal Alma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/53ba6f041ccc86b6efd6278d4bcffecc424dc8eeaca5593acab22ae19748f5cb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/53ba6f041ccc86b6efd6278d4bcffecc424dc8eeaca5593acab22ae19748f5cb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/53ba6f041ccc86b6efd6278d4bcffecc424dc8eeaca5593acab22ae19748f5cb?s=96&d=mm&r=g","caption":"Pascal Alma"},"description":"Pascal is a senior JEE Developer and Architect at 4Synergy in The Netherlands. Pascal has been designing and building J2EE applications since 2001. He is particularly interested in Open Source toolstack (Mule, Spring Framework, JBoss) and technologies like Web Services, SOA and Cloud technologies. Specialties: JEE, SOA, Mule ESB, Maven, Cloud Technology, Amazon AWS.","sameAs":["http:\/\/pragmaticintegrator.wordpress.com\/","http:\/\/www.linkedin.com\/in\/pascalalma","https:\/\/x.com\/https:\/\/twitter.com\/paskal_1973"],"url":"https:\/\/www.javacodegeeks.com\/author\/pascal-alma"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/56744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/366"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=56744"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/56744\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=56744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=56744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=56744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}