Class DelegatingPasswordEncoder
java.lang.Object
net.solarnetwork.central.security.DelegatingPasswordEncoder
- All Implemented Interfaces:
net.solarnetwork.service.PasswordEncoder,org.springframework.security.crypto.password.PasswordEncoder
public class DelegatingPasswordEncoder
extends Object
implements net.solarnetwork.service.PasswordEncoder, org.springframework.security.crypto.password.PasswordEncoder
Password encoder that delegates to a configurable list of Spring Security
org.springframework.security.crypto.password.PasswordEncoder
instances, returning passwords with a prefix tag to be able to recognize what
encryption technique was used.
The first entry in the map according to iteration order will be used as the
primary encoder. Thus a map implementation like
LinkedHashMap is recommended.
-
Constructor Summary
ConstructorsConstructorDescriptionDelegatingPasswordEncoder(Map<String, org.springframework.security.crypto.password.PasswordEncoder> encoders) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionencode(CharSequence rawPassword) booleanisPasswordEncrypted(CharSequence password) booleanmatches(CharSequence rawPassword, String encodedPassword) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.crypto.password.PasswordEncoder
upgradeEncoding
-
Constructor Details
-
DelegatingPasswordEncoder
public DelegatingPasswordEncoder(Map<String, org.springframework.security.crypto.password.PasswordEncoder> encoders) Constructor.- Parameters:
encoders- the encoders to use- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
isPasswordEncrypted
- Specified by:
isPasswordEncryptedin interfacenet.solarnetwork.service.PasswordEncoder
-
encode
- Specified by:
encodein interfacenet.solarnetwork.service.PasswordEncoder- Specified by:
encodein interfaceorg.springframework.security.crypto.password.PasswordEncoder
-
matches
- Specified by:
matchesin interfacenet.solarnetwork.service.PasswordEncoder- Specified by:
matchesin interfaceorg.springframework.security.crypto.password.PasswordEncoder
-