{"id":3963,"date":"2020-12-04T18:36:29","date_gmt":"2020-12-04T13:06:29","guid":{"rendered":"https:\/\/cns72.com\/vytcdc.com.sg\/?p=3963"},"modified":"2020-12-10T20:49:05","modified_gmt":"2020-12-10T15:19:05","slug":"spring-security-authentication-and-authorization","status":"publish","type":"post","link":"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/","title":{"rendered":"Spring Security: Authentication and Authorization"},"content":{"rendered":"<h3><strong>Introduction<\/strong><\/h3>\n<p>You can use this guide to understand what Spring Security is and how its core features like authentication, authorization, or common exploit protection work.<\/p>\n<p>Sooner or later everyone needs to add security to his project and in the Spring ecosystem, you do that with the help of the Spring Security library.<\/p>\n<p>So you go along, add Spring Security to your Spring Boot (or plain Spring) project, and suddenly\u2026\u200b<\/p>\n<p>\u2022 you have auto-generated login-pages.<br \/>\n\u2022 \u200byou cannot execute POST requests anymore.<br \/>\n\u2022 your whole application is on lockdown and prompts you to enter a username and password.<\/p>\n<p>Having survived the subsequent mental breakdown, you might be interested in how all of this works.<\/p>\n<p><strong>What is Spring Security and how does it work?<\/strong><\/p>\n<p>Spring Security is really just a bunch of servlet filters that help you add authentication and authorization to your web application.<\/p>\n<p>It also integrates well with frameworks like Spring Web MVC (or Spring Boot), as well as with standards like OAuth2. And it auto-generates login\/logout pages and protects against common exploits like CSRF.<\/p>\n<p><strong>Web Application Security:<\/strong><\/p>\n<p>Before you become a Spring Security Guru, you need to understand three important concepts:<br \/>\n\u2022 Authentication<br \/>\n\u2022 Authorization<br \/>\n\u2022 Servlet Filters<\/p>\n<p><span style=\"color: red;\">Download<\/span> the project here to learn and practice <span style=\"color: #ff0000;\"><em>Github<\/em><\/span> link below :<\/p>\n<p><a class=\"Spring\" href=\"https:\/\/github.com\/showagon\/SpringSecurity-Role-Base\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: blue;\">https:\/\/github.com\/showagon\/SpringSecurity-Role-Base<\/span><\/a><\/p>\n<p>Note: DB file also includes in the Github project itself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction You can use this guide to understand what Spring Security is and how its core features like authentication, authorization, or common exploit protection work. Sooner or later everyone needs to add security to his project and in the Spring ecosystem, you do that with the help of the Spring Security library. So you go [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3965,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[63],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.0.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring Security: Authentication and Authorization - TCDC<\/title>\n<link rel=\"canonical\" href=\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Security: Authentication and Authorization - TCDC\" \/>\n<meta property=\"og:description\" content=\"Introduction You can use this guide to understand what Spring Security is and how its core features like authentication, authorization, or common exploit protection work. Sooner or later everyone needs to add security to his project and in the Spring ecosystem, you do that with the help of the Spring Security library. So you go [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/\" \/>\n<meta property=\"og:site_name\" content=\"TCDC\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vytcdc\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-04T13:06:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-10T15:19:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cns72.com\/vytcdc.com.sg\/wp-content\/uploads\/2020\/12\/spring-security-tutorial.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"237\" \/>\n\t<meta property=\"og:image:height\" content=\"221\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vytcdc\" \/>\n<meta name=\"twitter:site\" content=\"@vytcdc\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/#website\",\"url\":\"https:\/\/cns72.com\/vytcdc.com.sg\/\",\"name\":\"TCDC\",\"description\":\"Career Development Courses\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/cns72.com\/vytcdc.com.sg\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/cns72.com\/vytcdc.com.sg\/wp-content\/uploads\/2020\/12\/spring-security-tutorial.jpg\",\"width\":237,\"height\":221},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/#webpage\",\"url\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/\",\"name\":\"Spring Security: Authentication and Authorization - TCDC\",\"isPartOf\":{\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/#primaryimage\"},\"datePublished\":\"2020-12-04T13:06:29+00:00\",\"dateModified\":\"2020-12-10T15:19:05+00:00\",\"author\":{\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/#\/schema\/person\/c57e5f7b91685a93f23a57aaafd38e82\"},\"breadcrumb\":{\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/\",\"url\":\"https:\/\/cns72.com\/vytcdc.com.sg\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/\",\"url\":\"https:\/\/cns72.com\/vytcdc.com.sg\/spring-security-authentication-and-authorization\/\",\"name\":\"Spring Security: Authentication and Authorization\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/#\/schema\/person\/c57e5f7b91685a93f23a57aaafd38e82\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/cns72.com\/vytcdc.com.sg\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f8f959f70994a4401c8704d6b2143474?s=96&d=mm&r=g\",\"caption\":\"admin\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/posts\/3963"}],"collection":[{"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/comments?post=3963"}],"version-history":[{"count":0,"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/posts\/3963\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/media\/3965"}],"wp:attachment":[{"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/media?parent=3963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/categories?post=3963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cns72.com\/vytcdc.com.sg\/wp-json\/wp\/v2\/tags?post=3963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}