<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">In
YourUserFederationProviderFactory.init you can read the
properties, which you configured in the keycloak-server.json. It's
used in the event example for instance. For UserFederation it
works the same way :
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/blob/master/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemEventStoreProviderFactory.java#L56">https://github.com/keycloak/keycloak/blob/master/examples/providers/event-store-mem/src/main/java/org/keycloak/examples/providers/events/MemEventStoreProviderFactory.java#L56</a>
<br>
<br>
Note that YourUserFederationProviderFactory.getId is corresponding
to the providerId used in keycloak-server.json . <br>
<br>
Btv. the
YourUserFederationProviderFactory.getConfigurationOptions() you
can return list of strings, which will be used as names of the
properties configurable in admin console. This is an alternative
to keycloak-server.json configuration. See the userFederation
example for more details.<br>
<br>
Marek<br>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<br>
On 01/08/16 19:23, Zhaohua Meng wrote:<br>
</div>
<blockquote
cite="mid:C48C3EB6-86AF-46B5-B844-710481B9C14E@appnexus.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Helvetica Neue";
        panose-1:2 0 5 3 0 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">I wrote a user federation SPI
implementation to integrate our internal user management.
Particularly, an implementation of
org.keycloak.models.UserFederationProviderFactory and
org.keycloak.models.UserFederationProvider.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">My question is, how do you
configure it in the
</span><span
style="font-size:14.0pt;font-family:"Helvetica
Neue";color:#262626">keycloak-server.json</span><span
style="font-size:14.0pt">?<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">The documentation gave example for
event listener but not user federation. Following the doc
with similar approach I tried “{ “userFederation”: {
“my-impl”: { “myProperty”:””, ...} …}}”, and all kinds of
combinations like that but nothing worked. I’d really
appreciate if you can share some experience here.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">I’m quoting the doc in this regard
here:
<a moz-do-not-send="true"
href="https://keycloak.gitbooks.io/server-developer-guide/content/v/2.0/topics/providers.html#providers"><span
style="color:#0B4CB4">https://keycloak.gitbooks.io/server-developer-guide/content/v/2.0/topics/providers.html#providers</span></a><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">...…<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">Configuring a provider<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">You can pass configuration options
to your provider by setting them in keycloak-server.json.
For example to set the max value for my-event-listener add:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> "eventsListener": {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> "my-event-listener": {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> "max": 100<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:14.0pt">…..<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:21.0pt"> </span><span
style="font-size:16.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:16.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">-- <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">Zhaohua
Meng<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">Business
Intelligence, AppNexus<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">973-936-8028
(cell)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:black">973-415-8028
(home)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</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>