<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_1_1445721568491_2637" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2639" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2641" class="">I'm using jboss keycloak 1.5 final version.</span></font></div><div id="yui_3_16_0_1_1445721568491_2643" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2645" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2647" class="">I developed my custom user federation provider interfacing with keycloak properties and my user enterprise database. </span></font></div><div id="yui_3_16_0_1_1445721568491_2649" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2651" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2653" class=""><br id="yui_3_16_0_1_1445721568491_2655" class=""></span></font></div><div id="yui_3_16_0_1_1445721568491_2657" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2659" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2661" class="">My need is to send up to user the login interface custom error messages based on particular specific error related to my legacy user db.</span></font></div><div id="yui_3_16_0_1_1445721568491_2663" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2665" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2667" class=""><br id="yui_3_16_0_1_1445721568491_2669" class=""></span></font></div><div id="yui_3_16_0_1_1445721568491_2671" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2673" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2675" class="">I saw keycloak themes have a resources folder by which i can localize and add new messages. Then i can reference them by angular js using </span></font></div><div id="yui_3_16_0_1_1445721568491_2677" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2679" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2681" class=""><br id="yui_3_16_0_1_1445721568491_2683" class=""></span></font></div><div id="yui_3_16_0_1_1445721568491_2685" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2687" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2689" class=""> $myMessage</span></font></div><div id="yui_3_16_0_1_1445721568491_2691" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2693" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2695" class=""><br id="yui_3_16_0_1_1445721568491_2697" class=""></span></font></div><div id="yui_3_16_0_1_1445721568491_2699" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2701" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2703" class="">notation. The problem is i want to rise up a message from keycloak server. My user federation provider implements UserFederationProvider interface. So i should have to override:</span></font></div><div id="yui_3_16_0_1_1445721568491_2705" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2707" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2709" class=""><br id="yui_3_16_0_1_1445721568491_2711" class=""></span></font></div><div id="yui_3_16_0_1_1445721568491_2713" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2715" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2717" class=""> @Override</span></font></div><div id="yui_3_16_0_1_1445721568491_2719" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2721" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2723" class=""><span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1445721568491_2725">        </span>public CredentialValidationOutput validCredentials(RealmModel realm, UserCredentialModel credential) {</span></font></div><div id="yui_3_16_0_1_1445721568491_2727" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2729" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2731" class=""><span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1445721568491_2733">                </span>LOGGER.info("validCredentials(realm, credential)");</span></font></div><div id="yui_3_16_0_1_1445721568491_2735" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2737" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2739" class=""><span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1445721568491_2741">                </span>return CredentialValidationOutput.failed();</span></font></div><div id="yui_3_16_0_1_1445721568491_2743" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2745" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2747" class=""><span class="" style="white-space:pre-wrap;" id="yui_3_16_0_1_1445721568491_2749">        </span>}</span></font></div><div id="yui_3_16_0_1_1445721568491_2751" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2753" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2755" class=""><br id="yui_3_16_0_1_1445721568491_2757" class=""></span></font></div><div id="yui_3_16_0_1_1445721568491_2751" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" class="" id="yui_3_16_0_1_1445721568491_2901"><span style="line-height: 18.2px;" class="" id="yui_3_16_0_1_1445721568491_2900"><div id="yui_3_16_0_1_1445721568491_2759" class="" style="color: rgb(0, 0, 0); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; line-height: normal;" dir="ltr"><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" class="" id="yui_3_16_0_1_1445721568491_2800"><span class="" id="yui_3_16_0_1_1445721568491_2799" style="line-height: 18.2px;">In the UserFederationProvider interface i read that </span></font><span style="line-height: 18.2px; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';" id="yui_3_16_0_1_1445721568491_2906" class="">validCredentials :</span></div><div id="yui_3_16_0_1_1445721568491_2759" class="" dir="ltr" style="color: rgb(0, 0, 0); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; line-height: normal;"><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" class="" id="yui_3_16_0_1_1445721568491_2876"><span class="" id="yui_3_16_0_1_1445721568491_2875"><span id="yui_3_16_0_1_1445721568491_2874" class="" style="line-height: 18.2px;">Validate credentials of unknown user. The authenticated user is recognized based on provided credentials and returned back in CredentialValidationOutput</span></span></font></div></span></font></div><div id="yui_3_16_0_1_1445721568491_2751" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" class=""><span style="line-height: 18.2px;" class=""><br></span></font></div><div id="yui_3_16_0_1_1445721568491_2759" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" id="yui_3_16_0_1_1445721568491_2761" class=""><span style="line-height: 18.2px;" id="yui_3_16_0_1_1445721568491_2763" class="">It seems to be the method i was looking for just because CredentialValidationOutput contains custom messages to be sent as validation output. The problem is this method is never called.</span></font></div><div id="yui_3_16_0_1_1445721568491_2759" class=""><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" class=""><span style="line-height: 18.2px;" class=""><br></span></font></div><div id="yui_3_16_0_1_1445721568491_2759" class="">The same happens to the close method. It's never called at the end of each request so i cannot dispose my objects</div><div id="yui_3_16_0_1_1445721568491_2759" class="" dir="ltr"><span style="line-height: 18.2px; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';">Why?</span><br></div><div id="yui_3_16_0_1_1445721568491_2759" class="" dir="ltr"><span style="line-height: 18.2px; color: rgb(51, 51, 51); font-family: Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';" id="yui_3_16_0_1_1445721568491_2938">Thanks a lot</span></div></div></body></html>