<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Yes, that works too. You can pass the
JSON object with properties "url", "realm" and "clientId" to the
constructor. See the docs with the example for this:
<a class="moz-txt-link-freetext" href="http://docs.jboss.org/keycloak/docs/1.2.0.Beta1/userguide/html/ch08.html#javascript-adapter">http://docs.jboss.org/keycloak/docs/1.2.0.Beta1/userguide/html/ch08.html#javascript-adapter</a><br>
<br>
Marek<br>
<br>
On 2.4.2015 22:02, Ryvlin, Andrey wrote:<br>
</div>
<blockquote
cite="mid:6d2823192e314b3f90af07ee5eb5b183@BLM-MAIL01P.l1id.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Marek,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I guess this
would work if I can pass Json object to Keycloak
constructor.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Is it possible?<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:#1F497D">Thanks‼<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">-----------------<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Andrey Ryvlin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Principal
Software Engineer<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Phone:
952-979-8492<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">5705 W Old
Shakopee Road, Suite 100<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Bloomington,
MN 55437 USA<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a
moz-do-not-send="true"
href="mailto:ARyvlin@MorphoTrust.com"><span
style="color:blue">ARyvlin@MorphoTrust.com</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a
moz-do-not-send="true"
href="http://www.morphotrust.com/"><span
style="color:blue">www.MorphoTrust.com</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><img
id="_x0000_i1027"
src="cid:part3.04040807.09020507@redhat.com"
alt="cid:image003.jpg@01CFF75A.60542BC0" border="0"
height="35" width="127"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
Marek Posolda [<a class="moz-txt-link-freetext" href="mailto:mposolda@redhat.com">mailto:mposolda@redhat.com</a>]
<br>
<b>Sent:</b> Thursday, April 02, 2015 1:05 PM<br>
<b>To:</b> Ryvlin, Andrey; <a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<b>Subject:</b> Re: [keycloak-user] keycloak.json file
for angular app<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi,<br>
<br>
I guess in your Angular application you're using something
like:<br>
<br>
var keycloakAuth = new Keycloak('keycloak.json');<br>
<br>
right? So instead of this, you can read the Keycloak
configuration from some separate URI like:<br>
<br>
var keycloakAuth = new Keycloak('myconfig');<br>
<br>
Where the path 'myconfig' could be mapped to some servlet
(or jaxrs application if you prefer), which will return you
the JSON with the configuration. So instead of serving the
configuration directly from file keycloak.json, you will
serve it from the servlet (or jaxrs app). The servlet will
run on server side, so you can use whatever is good for your
app to init the auth-server-url dynamically (For example
read it from System property)<br>
<br>
Marek<br>
<br>
<br>
On 2.4.2015 19:21, Ryvlin, Andrey wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi<o:p></o:p></p>
<p class="MsoNormal">I have AngularJs based UI web app talking
to RESTfull web services using Keycloak security.<o:p></o:p></p>
<p class="MsoNormal">Keycloak is running on a separate
instance of Wildfly having https connection.<o:p></o:p></p>
<p class="MsoNormal">UI Web application has keycloak.json file
with hardcoded Keycloak URL.<o:p></o:p></p>
<p class="MsoNormal">Everything works well with one problem:
when I need to install my web application to a different
environment I need to open WAR, modify keycloak.json with
new URL and package it back.<o:p></o:p></p>
<p class="MsoNormal">Since we deliver the entire installation
to the client, I don’t know their host names, so they have
to open WAR, which is in-convenient.
<o:p></o:p></p>
<p class="MsoNormal">Is there any way to avoid that? <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks‼<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks‼<o:p></o:p></p>
<p class="MsoNormal">-----------------<o:p></o:p></p>
<p class="MsoNormal">Andrey Ryvlin<o:p></o:p></p>
<p class="MsoNormal">Principal Software Engineer<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Phone: 952-979-8492<o:p></o:p></p>
<p class="MsoNormal">5705 W Old Shakopee Road, Suite 100<o:p></o:p></p>
<p class="MsoNormal">Bloomington, MN 55437 USA<o:p></o:p></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="mailto:ARyvlin@MorphoTrust.com">ARyvlin@MorphoTrust.com</a><o:p></o:p></p>
<p class="MsoNormal"><a moz-do-not-send="true"
href="http://www.morphotrust.com/">www.MorphoTrust.com</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><img id="Picture_x0020_3"
src="cid:part3.04040807.09020507@redhat.com"
alt="cid:image003.jpg@01CFF75A.60542BC0" border="0"
height="35" width="127"><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif""><o:p> </o:p></span></p>
<div class="MsoNormal" style="text-align:center"
align="center"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif"">
<hr align="center" size="2" width="100%">
</span></div>
<p class="MsoNormal"><span
style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray"><br>
This message is only for the use of the intended recipient
and may contain information that is CONFIDENTIAL and
PROPRIETARY to MorphoTrust USA, Inc. If you are not the
intended recipient, please erase all copies of the message
and its attachments and notify the sender immediately.<br>
</span><span style="font-size:12.0pt;font-family:"Times
New Roman","serif""><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>keycloak-user mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif""><o:p> </o:p></span></p>
</div>
</blockquote>
<br>
</body>
</html>