akshathajcta Posted December 25, 2013 Share Posted December 25, 2013 HI, M performing external login authentication for my requirement. It works fine with MD5/SHA encryption. My external database encrypts and stores password as below, md5(password + key):key where key-> randomly generated during pwd encryption.How i can validate encrypted password as above with jasperserver ? Please help. Thanks,Akshatha Link to comment Share on other sites More sharing options...
Solution akshathajcta Posted December 26, 2013 Author Solution Share Posted December 26, 2013 I found answer. Created my own password validation function,placed it inside WEB-INF/lib/customized.jar file, and called that function from applicationContext-externalAuth-db.xml as below. <bean id="passwordValidator" class="org.springframework.security.providers.encoding.CustomizedMd5PasswordEncoder"> <property name="encodeHashAsBase64"><value>false</value></property> </bean>Pasting my customized java function, package org.springframework.security.providers.encoding; import org.springframework.security.providers.encoding.Md5PasswordEncoder; public class CustomizedMd5PasswordEncoder extends Md5PasswordEncoder { public boolean isPasswordValid(String encPass, String rawPass, Object salt) { String[] pass1 = encPass.split(":"); if(pass1.length != 2) return false; String encResult= encodePassword(pass1[1]+rawPass, salt); if(encResult.equals(pass1[0])) return true; else return false; /* Above function is for my requirement, please make appropriate changes as you need*/ } }Refer below url for detail steps,http://community.jaspersoft.com/questions/817932/passwordvalidator-smd5Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now