I had seen Maven cannot compile Spring Security demo project. But my problem don't solve.
The problem is occur in following to code:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>5.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.0.7.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
java code(import):
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
run in mvn compile
:
package org.springframework.security.authentication.encoding does not exist
org.springframework.security » spring-security-coreApache. Spring Security is a powerful and highly customizable authentication and access-control framework. It provides protection against attacks like session fixation, clickjacking, cross site request forgery, etc. Last Release on Jun 20, 2022.
For adding a Spring Boot Security to your Spring Boot application, we need to add the Spring Boot Starter Security dependency in our build configuration file. Maven users can add the following dependency in the pom. xml file. Gradle users can add the following dependency in the build.
Class DelegatingPasswordEncoder A password encoder that delegates to another PasswordEncoder based upon a prefixed identifier.
org.springframework.security.crypto.password.MessageDigestPasswordEncoder
is also deprecated so we can go for org.springframework.security.crypto.password.DelegatingPasswordEncoder
which can be used for different types of algorithm by default it uses bcrypt but supports ldap,MD4, MD5, noop,pbkdf2,scrypt,SHA-1,SHA-256,sha256.
They are deprecated. You may try the replacement:
org.springframework.security.crypto.password.MessageDigestPasswordEncoder
More details are here: https://docs.spring.io/spring-security/site/docs/4.2.6.RELEASE/apidocs/org/springframework/security/crypto/password/MessageDigestPasswordEncoder.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With