Spring Boot Security Angular 8 Login Logout Example

Introduction Here we will create Spring Boot Security Angular Login Logout Example which will show you how to integrate Spring Security with Angular 8 to login to the application. We will redirect user to the login page if user is not already logged in. Similarly we will redirect user to the home page if user is already logged in. Because if user logged in then there is no point of showing the login page again when user click on the browser’s back button. Spring Boot’s default security mechanism will ask…

Continue

Spring Security – Authentication and Role Based Authorization using JWT

Introduction In this post we will see an example on Spring Security authentication and role based authorization using JWT (JSON Web Token) on REST or RESTful services. I won’t explain here about JWT as there is already very good article on JWT. We will implement Spring Security’s UserDetailsService to load user from database. We will use Spring JDBC API to perform database operations for fetching or saving user and roles into database. We will use H2 in-memory database to build a quick Spring Boot application. We will also use MySQL…

Continue

Spring Boot Security – Form Based Authentication – Persistence Token – Remember Me

Introduction The example Spring Boot Security form based authentication persistence token remember me will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based authentication remember me – persistent token – on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. We will add additional field as remember me into the login form. This tutorial will show you how to remember your credentials for a specific time period for auto-login without providing any login credentials into…

Continue

Spring Boot Security – Form Based Authentication – Remember Me

Introduction The example Spring Boot Security form based authentication remember me will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user with remember me option. You may also look into form based authentication – remember me – on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. We will add additional field as remember me into the login form. This tutorial will show you how to remember your credentials for a specific time period for auto-login without providing any login credentials into…

Continue

Spring Boot Security – Form Based JDBC Authentication using UserDetailsService

Introduction The example Spring Boot Security form based JDBC authentication using UserDetailsService will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based JDBC authentication using UserDetailsService on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. In the previous example we had used Resource Bundle that will also help you to make your application internationalization.

Continue

Spring Boot Security – Form Based JDBC Authentication

Introduction The example, Spring Boot Security form based JDBC authentication, will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based jdbc authentication on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. In the previous example we had used Resource Bundle that will also help you to make your application internationalization.

Continue

Spring Boot Security – Form Based Authentication

Introduction The example Spring Boot Security form based authentication will show you how to use custom login form with Spring’s j_spring_security_check to authenticate a user. You may also look into form based authentication on Spring MVC framework. The similar example we will implement here but using Spring Boot framework. In the previous example we have also used Resource Bundle that will also help you to make your application internationalization.

Continue

Spring Boot Security Example – Single Sign On using OAuth 2

Introduction Here we will see Spring Boot Security Example – Single Sign On using OAuth 2. Single Sign On or simply SSO is a property of access control of multiple related, yet independent, software systems, where a user logs in with a single set of credentials (username and password) to gain access. Here we will use Spring Boot 2.14. We will let client access our App by granting access through Github OAuth 2 API. You can also use other OAuth 2 API, such as, Google, Facebook etc. Even you can…

Continue

Spring Boot Actuator – Securing HTTP Endpoints

Introduction Here we will see example on securing HTTP endpoints in Spring Boot application. Like other sensitive URLs, you should take care to secure HTTP endpoints. If Spring Security is present, endpoints are secured by default using Spring Security’s content-negotiation strategy. If you wish to configure custom security for HTTP endpoints, for example, only allow users with a certain role to access them, Spring Boot provides some convenient RequestMatcher objects that can be used in combination with Spring Security. You may also like to read Spring Boot Actuator – Accessing…

Continue

Spring EnableEncryptableProperties with Jasypt

Introduction Spring EnableEncryptableProperties with Jasypt shows an example how to avoid putting clear text password for database connection’s credentials in properties file. Jasypt means Java simplified encryption. Here we are going to use Spring Boot with Jasypt (Java simplified encryption). Here we are also going to use Spring Data JPA to perform the data layer activities with database. If you put clear text password in properties file then everybody including people, who should not see password, would gain access to your database and may change database table values, table structure…

Continue