How to Manually Authenticate User with Spring Security 1. Overview In this quick article, we’ll focus on how to programmatically set an authenticated user in Spring Security and Spring MVC. 2. Spring Security Simply put, Spring Security hold the principal information of each authenticated user in a ThreadLocal – represented… Continue Reading manually-set-user-authentication-spring-security

Spring Security Form Login 1. Introduction This article is going to focus on Login with Spring Security. We’re going to build on top of the simple previous Spring MVC example, as that’s a necessary part of setting up the web application along with the login mechanism. Further reading: Spring Security… Continue Reading spring-security-login

Extra Login Fields with Spring Security 1. Introduction In this article, we’ll implement a custom authentication scenario with Spring Security by adding an extra field to the standard login form. We’re going to focus on 2 different approaches, to show the versatility of the framework and the flexible ways we… Continue Reading spring-security-extra-login-fields

Spring Security Login Page with Angular 1. Overview In this tutorial, we’ll be creating a login page using Spring Security with: AngularJS Angular 2, 4, 5, and 6 The example application which we’re going to discuss here consists of a client application that communicates with the REST service, secured with… Continue Reading spring-security-login-angular

Basic and Digest Authentication for a REST Service with Spring Security Table of Contents * 1. Overview * 2. Configuration of Basic Authentication * 2.1. Satisfying the stateless constraint – getting rid of sessions * 3. Configuration of Digest Authentication * 4. Supporting both authentication protocols in the same RESTful… Continue Reading basic-and-digest-authentication-for-a-rest-api-with-spring-security

Spring Security Authentication Provider 1. Overview This tutorial will show how to set up an Authentication Provider in Spring Security to allow for additional flexibility compared to the standard scenario using a simple UserDetailsService. 2. The Authentication Provider Spring Security provides a variety of options for performing authentication. These follow… Continue Reading spring-security-authentication-provider

Spring Security: Authentication with a Database-backed UserDetailsService 1. Overview In this article, we will show how to create a custom database-backed UserDetailsService for authentication with Spring Security. 2. UserDetailsService The UserDetailsService interface is used to retrieve user-related data. It has one method named loadUserByUsername() which can be overridden to customize… Continue Reading spring-security-authentication-with-a-database

Spring Security Authentication Tutorial Login / Authentication + Form Login + Login – Error Handling and Localization + Prevent Brute Force Authentication Attempts + Roles and Privileges + Remember Me + Persistent Remember Me + Redirect to different pages after Login + Logout A Production-Grade Registration Process + Spring Security… Continue Reading spring-security-authentication-and-registration

Multiple Authentication Providers in Spring Security 1. Overview In this quick article, we’re going to focus on using multiple mechanisms to authenticate users in Spring Security. We’ll do that by configuring multiple authentication providers. 2. Authentication Providers An AuthenticationProvider is an abstraction for fetching user information from a specific repository… Continue Reading spring-security-multiple-auth-providers

A Secondary Facebook Login with Spring Social 1. Overview In this tutorial, we’ll focus on adding a new Facebook login to an existing form-login app. We’re going to be using the Spring Social support to interact with Facebook and keep things clean and simple. 2. Maven Configuration First, we will… Continue Reading facebook-authentication-with-spring-security-and-social