<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 24/10/15 23:27, alex orl wrote:<br>
</div>
<blockquote
cite="mid:1792405579.3711775.1445722078748.JavaMail.yahoo@mail.yahoo.com"
type="cite">
<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
id="yui_3_16_0_1_1445721568491_2639" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2645" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2651" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2659" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2665" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2673" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2679" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2687" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2693" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2701" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2707" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2715" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2721" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2729" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2737" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2745" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
id="yui_3_16_0_1_1445721568491_2753" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
class="" id="yui_3_16_0_1_1445721568491_2901"
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
class="" id="yui_3_16_0_1_1445721568491_2800"
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
class="" id="yui_3_16_0_1_1445721568491_2876"
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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
class="" face="Helvetica, arial, nimbussansl,
liberationsans, freesans, clean, sans-serif, Segoe UI Emoji,
Segoe UI Symbol" color="#333333"><span style="line-height:
18.2px;" class=""><br>
</span></font></div>
<div id="yui_3_16_0_1_1445721568491_2759" class=""><font
id="yui_3_16_0_1_1445721568491_2761" class=""
face="Helvetica, arial, nimbussansl, liberationsans,
freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI
Symbol" color="#333333"><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>
</blockquote>
<font color="#333333"><font face="Helvetica, arial, nimbussansl,
liberationsans, freesans, clean, sans-serif, Segoe UI Emoji,
Segoe UI Symbol">This method is called by Keycloak just during
use-cases, when you want to authenticate with unknown user.
Which is currently during Kerberos/SPNEGO login. It's not called
during basic flow with username/password authentication. <br>
<br>
I think if you want to propagate error messages, you can for
example throw ModelException with the error message you want.</font></font><br>
<blockquote
cite="mid:1792405579.3711775.1445722078748.JavaMail.yahoo@mail.yahoo.com"
type="cite">
<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_2759" class=""><font
class="" face="Helvetica, arial, nimbussansl,
liberationsans, freesans, clean, sans-serif, Segoe UI Emoji,
Segoe UI Symbol" color="#333333"><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>
</blockquote>
Feel free to create JIRA for the close method.<br>
<br>
Marek<br>
<blockquote
cite="mid:1792405579.3711775.1445722078748.JavaMail.yahoo@mail.yahoo.com"
type="cite">
<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_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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</body>
</html>