Spring security custom login annotation

As we discussed in our earlier examples that Spring Security will create a default login form automatically and we do not have to create any new jsp page. But we can create our custom login page. Directory Structure pom.xml file <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>w3schools</groupId> <artifactId>SpringSecurity03</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>SpringSecurityld Maven Webapp</name> <url>http://maven.apache.org</url>   … Read more

Spring security login

Directory Structure pom.xml file <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>w3schools</groupId> <artifactId>SpringSecurity02</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>SpringSecurityld Maven Webapp</name> <url>http://maven.apache.org</url>   <properties> <spring.version>5.0.2.RELEASE</spring.version> <spring.security.version>5.0.0.RELEASE</spring.security.version> <jstl.version>1.2</jstl.version> </properties>   <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!– Spring dependencies –> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency>   <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency>   <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency>   <!– … Read more

Spring security hello world annotation

Directory Structure pom.xml file <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>w3schools</groupId> <artifactId>SpringSecurity02</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>SpringSecurityld Maven Webapp</name> <url>http://maven.apache.org</url>   <properties> <spring.version>5.0.2.RELEASE</spring.version> <spring.security.version>5.0.0.RELEASE</spring.security.version> <jstl.version>1.2</jstl.version> </properties>   <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!– Spring dependencies –> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency>   <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency>   <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency>   <!– … Read more

Spring security hello world xml

Directory Structure pom.xml file <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>w3schools</groupId> <artifactId>SpringSecurity</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>SpringSecurityld Maven Webapp</name> <url>http://maven.apache.org</url>   <properties> <spring.version>5.0.2.RELEASE</spring.version> <spring.security.version>5.0.0.RELEASE</spring.security.version> <jstl.version>1.2</jstl.version> </properties>   <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!– Spring dependencies –> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency>   <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency>   <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency>   <!– … Read more

Spring security maven dependency

spring-security-core It contains authentication and access control functionality. <properties> <org.springframework.security.version>3.2.3.RELEASE</org.springframework.security.version> <org.springframework.version>4.0.4.RELEASE</org.springframework.version> </properties> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>${org.springframework.security.version}</version> </dependency><properties> <org.springframework.security.version>3.2.3.RELEASE</org.springframework.security.version> <org.springframework.version>4.0.4.RELEASE</org.springframework.version> </properties> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>${org.springframework.security.version}</version> </dependency> spring-security-web It contains filters and other web security related features. <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>${org.springframework.security.version}</version> </dependency><dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>${org.springframework.security.version}</version> </dependency> spring-security-config It is used for configuring the authentication providers. Authentication providers … Read more

Spring security architecture diagram

Spring security architecture diagram Spring Security Authentication Spring security provides AuthenticationManager interface for authentication process. It has only one method. public interface AuthenticationManager { Authentication authenticate(Authentication authentication) throws AuthenticationException; }public interface AuthenticationManager { Authentication authenticate(Authentication authentication) throws AuthenticationException; } The authenticate() method can return an Authentication if the input represents a valid principal. Normally it … Read more

Spring security tutorial

Dictionary meaning of Security: The state of being free from danger or threat. Spring security Spring security is a flexible and powerful authentication and authorization framework to create secure J2EE-based Enterprise Applications. Authentication: It is a process or action of verifying the identity of a user or process i.e. who are you? Authorization: It is a … Read more

Shallow copy and deep copy in java

Before discussing differences between shallow copy and deep copy let’s discuss what a copy is? We can have two types of copies: Reference copy: It creates a copy of a reference variable pointing to an object. Object copy: It creates a copy of the object itself. Shallow copy Shallow means having little depth. Shallow copy … Read more

java array interview programs

Java arrays are group of homogeneous elements. Homogeneous means – of the same kind i.e. Java arrays contains the elements of same type. Syntax datatype[] array_name; or datatype array_name[]; List of java array interview programs Java program to find duplicate elements in an array. Java program to find second largest element in an array of … Read more