Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.springframework.security.authentication.encoding don't exist in maven

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
like image 537
yanpahika Avatar asked Jun 25 '18 15:06

yanpahika


People also ask

What is org Springframework security?

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.

How do I add Spring Security dependency in POM XML?

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.

What is DelegatingPasswordEncoder?

Class DelegatingPasswordEncoder A password encoder that delegates to another PasswordEncoder based upon a prefixed identifier.


2 Answers

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.

like image 64
Fatima Naik Avatar answered Nov 14 '22 23:11

Fatima Naik


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

like image 34
Pete T Avatar answered Nov 15 '22 00:11

Pete T