Open PriyankaNaikwade opened 5 years ago
This repository is for the original Javascript library. You probably want https://github.com/nulab/zxcvbn4j which is the Java port you imported via Maven.
we already added maven dependency in our project but still we are facing issue in environment. and we are using java 1.6.
You're not understanding. Java and Javascript are not the same language. We have absolutely nothing to do with the Maven package. Go to the link I posted above and open an issue there instead.
@PriyankaNaikwade We already released version 1.2.7 that fixed the problem. https://github.com/nulab/zxcvbn4j/releases/tag/1.2.7
Hi Team,
we have added maven dependency & version is 1.2.6. & we are just using following code snippet when we try to measure strength of password we are getting error. we are using java 1.6. so is it issue?
Code snippet: Zxcvbn zxcvbn = new Zxcvbn(); Strength localizStrength = zxcvbn.measure(password); int zxcvbnScore = localizStrength.getScore(); logger.info("Score Of Password:"+ zxcvbnScore); switch ( zxcvbnScore ) { case 4: logger.info("Password Strength is Very Strong"); break; case 3: logger.info("Password Strength is Strong"); break; case 2: logger.info("Password Strength is Good"); break; case 1: logger.error("Password Strength is Weak"); Feedback feedback = localizStrength.getFeedback(); List localizedSuggestions = feedback.getSuggestions();
String localizedWarning = feedback.getWarning();
System.out.println("localizedSuggestions:="+ localizedSuggestions);
System.out.println("LocalizedWarnings:="+localizedWarning);
result.add(rule);
break;
default:
logger.error("Password Strength is very Weak");
Feedback feedback1 = localizStrength.getFeedback();
List localizedSuggestions1 = feedback1.getSuggestions();
String localizedWarning1 = feedback1.getWarning();
System.out.println("localizedSuggestions:="+ localizedSuggestions1);
System.out.println("LocalizedWarnings:="+localizedWarning1);
result.add(rule);
break;
Error Trace:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.nulabinc.zxcvbn.Matching at com.nulabinc.zxcvbn.Zxcvbn.createMatching(Zxcvbn.java:45) at com.nulabinc.zxcvbn.Zxcvbn.measure(Zxcvbn.java:32) at com.nulabinc.zxcvbn.Zxcvbn.measure(Zxcvbn.java:15) at com.riskmetrics.wb.service.impl.PasswordServiceImpl.validate(PasswordServiceImpl.java:123) at com.riskmetrics.apollo.spring.controller.PasswordController.validatePassword(PasswordController.java:412) at com.riskmetrics.apollo.spring.controller.PasswordController.validate(PasswordController.java:71) at sun.reflect.GeneratedMethodAccessor652.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ... 79 more