All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.osgiliath.feature.itest.security.conf.BaseEncodingProvider Maven / Gradle / Ivy

The newest version!
package net.osgiliath.feature.itest.security.conf;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;

import org.springframework.security.authentication.dao.ReflectionSaltSource;
import org.springframework.security.authentication.dao.SaltSource;
import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;



@ApplicationScoped
public class BaseEncodingProvider {

	@Produces
	public SaltSource createSaltSource() {
		ReflectionSaltSource ret = new ReflectionSaltSource();
		ret.setUserPropertyToUse("pseudo");
		return ret;
	}
	@Produces
	public PasswordEncoder createPasswordEncoder() {
		ShaPasswordEncoder pwdEncoder = new ShaPasswordEncoder(512);
		pwdEncoder.setEncodeHashAsBase64(true);
		return pwdEncoder;
		
	}
	
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy