-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change passwordencoder fot bcrypt to delegating(pbkdf2) #424
- Loading branch information
1 parent
cf1124e
commit d997278
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...e-domain/src/main/java/xxxxxx/yyyyyy/zzzzzz/domain/common/PasswordEncoderFactoryBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package xxxxxx.yyyyyy.zzzzzz.domain.common; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.springframework.beans.factory.FactoryBean; | ||
import org.springframework.security.crypto.password.DelegatingPasswordEncoder; | ||
import org.springframework.security.crypto.password.PasswordEncoder; | ||
import org.springframework.security.crypto.password.Pbkdf2PasswordEncoder; | ||
|
||
public class PasswordEncoderFactoryBean implements FactoryBean<PasswordEncoder>{ | ||
|
||
private PasswordEncoder passwordencoder; | ||
|
||
public PasswordEncoderFactoryBean(){ | ||
String encodingId = "pbkdf2"; | ||
Map<String, PasswordEncoder> encoders = new HashMap<>(); | ||
encoders.put(encodingId, new Pbkdf2PasswordEncoder()); | ||
passwordencoder = new DelegatingPasswordEncoder(encodingId, encoders); | ||
} | ||
|
||
@Override | ||
public PasswordEncoder getObject() throws Exception { | ||
return passwordencoder; | ||
} | ||
|
||
@Override | ||
public Class<?> getObjectType() { | ||
return PasswordEncoder.class; | ||
} | ||
|
||
@Override | ||
public boolean isSingleton() { | ||
return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters