Review
In the previous section, we have discussed the Spring Social-related configuration. In this section we will focus on Spring Security for securing our application.Table of Contents
Click on a link to jump to that section:
- Functional Specs
- Generate OAuth keys
- Spring Social configuration
- Spring Security configuration
- JavaConfig
- ApplicationInitializer.java
- ApplicationContext.java
- DataConfig.java
- ThymeleafConfig.java
- spring.properties
- View with Thymeleaf
- Layers
- Domain
- Repository
- Service
- Controller
- Running the application
- Clone from GitHub
- Create the Database
- Run with Maven and Tomcat 7
- Run with Maven and Jetty 8
- Import to Eclipse
- Validate with W3C
Spring Security
What is Spring Security?
Spring Security is a powerful and highly customizable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications.
Spring Security is one of the most mature and widely used Spring projects. Founded in 2003 and actively maintained by SpringSource since, today it is used to secure numerous demanding environments including government agencies, military applications and central banks. It is released under an Apache 2.0 license so you can confidently use it in your projects.
Source: http://www.springsource.org/spring-security
Here's our Spring Security configuration:
SecurityConfig.java
First, we declare a DelegatingFilterProxy bean using JavaConfig. This allows Spring Security to intercept requests to our application and verify if the required authentication and authorization are met. This bean needs to be registered in the web.xml (or ApplicationInitializer) as a filter (see next section).
Second, we declare the usual XML-based configuration. This allows us to define the intercept-url patterns. Why are we not using JavaConfig here? Because the XML-based configuration is simpler, less-verbose, and easier:
spring-security.xml
For an in-depth explanation of this configuration, please see my tutorial on Spring Security 3.1 - Implement UserDetailsService with Spring Data JPA
Next
In the next section, we will study the remaining JavaConfig-based configuration. Click here to proceed.
Share the joy:
|
Subscribe by reader Subscribe by email Share
Hi sir This is very nice blog.
ReplyDeleteThis helped me alot.
Sir i want JAAS Integration with SpringMVC frame work. Can you please help me out
Thanks.
Dillirao
Your blog is so helpful, ever since I found it I have spent scountless hours on it and it is so easy to follow. You are the reason I was able to complete a lot of my projects at work with very little downtime.
ReplyDeleteThank you so much for taking the time to explain every minute detail.
generate OAuth keys for Facebook and Twitter (Online Java Training) Generate OAuth keys Java Training in Chennai Consumer key and Consumer secret values: J2EE Training in Chennai
ReplyDeleteI have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteSpring online training Spring online training Spring Hibernate online training Spring Hibernate online training Java online training
spring training in chennai spring hibernate training in chennai
great article
ReplyDeleteJava training | best java training | Java training and placement | java training in chennai
Easy "water hack" burns 2 lbs OVERNIGHT
ReplyDeleteAt least 160,000 women and men are utilizing a easy and secret "water hack" to lose 1-2lbs every night while they sleep.
It's effective and it works on everybody.
Here's how you can do it yourself:
1) Hold a glass and fill it with water half full
2) And now learn this crazy HACK
and be 1-2lbs thinner the very next day!
You ought to experience a contest first of the finest blogs on-line. I will suggest this page! Eminem, also known as Marshall Mathers, is one of the most commercially successful rappers of all time, with more than 100 million albums sold worldwide. He is one of the richest rappers in the world, with an estimated net worth of $210 million. Visit Eminem net worth for more information.
ReplyDeleteWOW! I Love it...
ReplyDeleteand i thing thats good for you >>
เปิดวาร์ป ยูมิโกะ เน็ตไอดอลสายหวิว
Thank you!