<div dir="ltr">Token-store is for server-side adapter. Public-client is ignored as it will simply use the presence of secret, but it's pointless to have a confidential html5 client as the secret would be public. Public key is not needed for js as it doesn't verify the token, it could, but wouldn't have much value as the services would do that anyways.</div><div class="gmail_extra"><br><div class="gmail_quote">On 15 April 2016 at 17:29, Michael Clayton <span dir="ltr"><<a href="mailto:mclayton@redhat.com" target="_blank">mclayton@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, that helps. I'm happy to go with that approach, but it would<br>
help me if I understood why most of the values in keycloak.json are not<br>
needed by keycloak.js.<br>
<br>
Are "token-store", "public-client" etc totally ignored by keycloak.js?<br>
A quick grep suggests that they are ignored.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Michael Clayton<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Fri, Apr 15, 2016 at 07:45:59AM +0200, Stian Thorgersen wrote:<br>
> You don't need to pass in the whole keycloak.json like this, to initialize<br>
> it without the request for keycloak.json just do:<br>
><br>
> new Keycloak({<br>
> realm: "myReam",<br>
> clientId: "myClientId"<br>
> }<br>
><br>
> That's it.<br>
><br>
><br>
> On 14 April 2016 at 21:59, Michael Clayton <<a href="mailto:mclayton@redhat.com">mclayton@redhat.com</a>> wrote:<br>
><br>
> > Hi all,<br>
> ><br>
> > I'm integrating keycloak.js with the Red Hat Customer Portal and have a<br>
> > question about passing a configuration object into the Keycloak()<br>
> > constructor.<br>
> ><br>
> > At the point where I call Keycloak(), I'm attempting to avoid waiting<br>
> > for the keycloak.json HTTP GET by inlining keycloak.json during a build<br>
> > step. By example, my build now produces this:<br>
> ><br>
> > var keycloak = new Keycloak({<br>
> > "realm" : "myRealm",<br>
> > "realm-public-key" : "myPublicKey",<br>
> > "auth-server-url" : "<a href="https://keycloak.me/auth" rel="noreferrer" target="_blank">https://keycloak.me/auth</a>",<br>
> > "ssl-required" : "external",<br>
> > "resource" : "myClientId",<br>
> > "public-client" : true,<br>
> > "token-store": "cookie"<br>
> > });<br>
> ><br>
> > I was hoping this would Just Work, but I quickly discovered that some of<br>
> > the properties are "renamed" after the HTTP request:<br>
> ><br>
> > kc.authServerUrl = config['auth-server-url'];<br>
> > kc.realm = config['realm'];<br>
> > kc.clientId = config['resource'];<br>
> > kc.clientSecret = (config['credentials'] || {})['secret'];<br>
> ><br>
> > And thus my setup doesn't work because "clientId" doesn't exist inside<br>
> > keycloak.json.<br>
> ><br>
> > My question is: would I be foolish to rename the properties inside<br>
> > keycloak.json so that the JSON can be passed directly into the Keycloak<br>
> > constructor? For example, "resource" becomes "clientId" and<br>
> > "auth-server-url" becomes "authServerUrl".<br>
> ><br>
> > It would be really convenient if I could give keycloak.js the contents<br>
> > of keycloak.json without having to fret about where it came from (AJAX<br>
> > or hardcoded or build-inlined). If others would like that feature too,<br>
> > I'd happily put together a contribution.<br>
> ><br>
> > Thanks for any advice!<br>
> ><br>
> > --<br>
> > Michael Clayton<br>
> > _______________________________________________<br>
> > keycloak-user mailing list<br>
> > <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
> ><br>
</div></div></blockquote></div><br></div>