<div dir="ltr">Solution: I had to register the CustomRequiredAction via the Register button that appears under Realm > Authentication > Required Actions ...</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 5:25 PM, Adrian Matei <span dir="ltr"><<a href="mailto:adrianmatei@gmail.com" target="_blank">adrianmatei@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi guys,<div><br></div><div>in the UpdatePassword class we need to modify the string values that come from formData</div><div>so that there are not "password-new" but "passwordNew" (JS conform as we've build the GUI with AngularJS on top of Freemarker actions):<br><div><a href="https://github.com/keycloak/keycloak/blob/de472dbd43dd2767afb3436835f77924a78e9f82/services/src/main/java/org/keycloak/authentication/requiredactions/UpdatePassword.java#L67" target="_blank">https://github.com/keycloak/keycloak/blob/de472dbd43dd2767afb3436835f77924a78e9f82/services/src/main/java/org/keycloak/authentication/requiredactions/UpdatePassword.java#L67</a><br></div><div><br></div><div><br></div><div>We've created our own CustomUpdatePassword (similar with the class above except the two lines and own id -UPDATE_PASSWORD_CUSTOM) and tried to hook it in our own custom ResetPassword class:</div></div><div><div> @Override</div><div> public void authenticate(AuthenticationFlowContext context) {</div><div> if (context.getExecution().isRequired() ||</div><div> (context.getExecution().isOptional() &&</div><div> configuredFor(context))) {</div><div> context.getClientSession().addRequiredAction(CustomUpdatePassword.UPDATE_PASSWORD_CUSTOM);</div><div> }</div><div> context.success();</div><div> }</div></div><div><br></div><div>The custom classes are registered in META-INF services and everything, and we can add the custom reset password execution in the Reset Credentials workflow...</div><div><br></div><div>The result is a NPE in AuthenticationManager by trying to get the providerId from the model</div><div><div>RequiredActionProviderModel model = realm.getRequiredActionProviderByAlias(action);</div><div>RequiredActionFactory factory = (RequiredActionFactory)session.getKeycloakSessionFactory().getProviderFactory(RequiredActionProvider.class, model.getProviderId());</div></div><div><br></div><div>I am tired and cannot look through anymore, so your advice is more than welcomed...</div><div><br></div><div>Thanks,</div><div>Adrian</div><div><br></div><div><br></div></div>
</blockquote></div><br></div>