package it.mice.voila.runtime.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.authentication.dao.SaltSource;
import org.springframework.security.authentication.encoding.PasswordEncoder;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * This class exists only because the new spring security infrastructure is too protected !!!
 * Overriding all getters to extends its visibility from protected to public to allow more
 * flexible usage.
 */
public class DefaultDaoAuthenticationProvider extends DaoAuthenticationProvider {


    protected void doAfterPropertiesSet() throws Exception {
    	super.doAfterPropertiesSet();
    }

	@Autowired
	public void setPasswordEncoder(PasswordEncoder passwordEncoder) {
		// TODO Auto-generated method stub
		super.setPasswordEncoder(passwordEncoder);
	}

	@Autowired(required=false)
	public void setSaltSource(SaltSource saltSource) {
		// TODO Auto-generated method stub
		super.setSaltSource(saltSource);
	}

	@Autowired
	public void setUserDetailsService(UserDetailsService userDetailsService) {
		// TODO Auto-generated method stub
		super.setUserDetailsService(userDetailsService);
	}

	@Override
	public PasswordEncoder getPasswordEncoder() {
		// TODO Auto-generated method stub
		return super.getPasswordEncoder();
	}

	@Override
	public SaltSource getSaltSource() {
		// TODO Auto-generated method stub
		return super.getSaltSource();
	}

	@Override
	public UserDetailsService getUserDetailsService() {
		// TODO Auto-generated method stub
		return super.getUserDetailsService();
	}

}
