This tutorial shows you Remember-Me authentication using Spring Security 4 with Hibernate. Let’s get going. In Remember-me or persistent-login authentication, Applications remember the identity of user between sessions. Basically, during login, when you ask for Remember-Me support, application will send a cookie to the browser during login. This cookie will be stored at browser side…
Continue readingSpring Security 4 Hibernate Password Encoder Bcrypt Example
This tutorial shows Password Encoding in Spring Security 4 using BCryptPasswordEncoder. We will take a Spring MVC 4, Hibernate 4 & Spring Security 4 example to demonstrate a real-world setup involving login authentication and user creation.Both Annotation + XML based projects are available for download at the end of this post. Let’s get going. Other…
Continue readingSpring Security 4 Hibernate Role Based Login Example
This post shows how to use role based login in Spring Security 4 using Hibernate setup. That means redirecting users to different URLs upon login according to their assigned roles, this time along with Hibernate setup. Let’s get going. This post complements the post Spring Security 4 Hibernate Annotation Example, and simply adds the Role…
Continue readingSpring Security 4 Hibernate Integration Annotation+XML Example
This tutorial demonstrates integrating Hibernate with Spring Security 4 to perform database authentication, showing Annotation+XML configuration example in Spring 4 MVC application. Let’s get going. In this post we will learn Spring Security database authentication using Hibernate annotation+xml based approach. Previous posts discussed about Spring Security in-memory authentication. But in real-world projects, credentials are often…
Continue readingSpring Security 4 Secure View Fragments using taglibs
This tutorial shows you how to secure view layer, show/hide parts of jsp/view based on logged-in user’s roles, using Spring Security tags in Spring MVC web application. Let’s get going. Other interesting posts you may like Spring Boot+AngularJS+Spring Data+Hibernate+MySQL CRUD App Spring Boot REST API Tutorial Spring Boot WAR deployment example Secure Spring REST API…
Continue readingSpring Security 4 Logout Example
This post shows you how to programatically logout a user in Spring Security. This works well with browser back button too. Let’s get going. Other interesting posts you may like Spring Boot+AngularJS+Spring Data+Hibernate+MySQL CRUD App Spring Boot REST API Tutorial Spring Boot WAR deployment example Secure Spring REST API using OAuth2 Spring Boot Introduction +…
Continue readingSpring Security 4 Custom Login Form Annotation+XML Example
This post shows you creating custom login form in Spring Security 4 and integrate it in Spring MVC web application. In Spring Security 4 Hello World Annotation+xml example, we have seen the default login form provided by Spring Security in case we don’t specify one. In this post, we will create our own Custom login…
Continue readingSpring Security 4 Hello World Annotation+XML Example
This tutorial demonstrates Spring Security 4 usage to secure a Spring MVC web application, securing URL access with authentication. We will use classic Hello World example to learn Spring Security 4 basics. This post uses Spring Annotation based configuration for Servlet 3.0 containers [hence no web.xml] and also shows corresponding XML based Security configuration for…
Continue readingTesting data access layer using Testng, DBunit, Mockito, H2 & Spring-test
Testing DAO or data access layer is always a subject of debate. What exactly we want to test? Do we just want to test the methods from DAO implementation class and making sure that each and every line of code in those methods is covered? If we think in terms of unit-test, than our goal…
Continue readingHow to setup MySQL on local PC
In this post, we will learn how to setup MySQL on our local machines/system. This is one of the possible way to install, although you may prefer another approaches. We will be installing both workbench and MySQL Server together using MySQL Community Server Let’s begin. Step 1: Download Community Server from here. Current version is…
Continue reading