<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Then maybe the easiest path is to
      configure error page at undertow subsystem level in standalone.xml
      . You can take a look for example at
      <a class="moz-txt-link-freetext" href="https://developer.jboss.org/thread/251980?start=0&amp;tstart=0">https://developer.jboss.org/thread/251980?start=0&amp;tstart=0</a> <br>
      <br>
      Marek<br>
      <br>
      On 07/06/16 19:21, Haim Vana wrote:<br>
    </div>
    <blockquote
cite="mid:HE1PR03MB138563E279E9D0AD45C692C3D25D0@HE1PR03MB1385.eurprd03.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \,serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* 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:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        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;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {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">It's pretty
            straight forward the JS utility
          </span><span style="color:#1F497D">redirects us to KeyCloak
            with a realm that doesn’t exist, marked in yellow below.<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"><a
              moz-do-not-send="true"
href="http://192.168.99.100:9090/auth/realms/1000000121/protocol/openid-connect/auth?client_id=reportium&amp;redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F%3FTENANTID%3D1000000121&amp;state=20d710ca-ffe3-4c67-b495-bdb6fc9bad40&amp;response_type=code"><a class="moz-txt-link-freetext" href="http://192.168.99.100:9090/auth/realms/">http://192.168.99.100:9090/auth/realms/</a><span
                style="background:yellow;mso-highlight:yellow">1000000121</span>/protocol/openid-connect/auth?client_id=reportium&amp;redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F%3FTENANTID%3D1000000121&amp;state=20d710ca-ffe3-4c67-b495-bdb6fc9bad40&amp;response_type=code</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">KeyCloak
            returns 404 resulting in a blank page.<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"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                style="color:windowtext"> Marek Posolda
                [<a class="moz-txt-link-freetext" href="mailto:mposolda@redhat.com">mailto:mposolda@redhat.com</a>]
                <br>
                <b>Sent:</b> Tuesday, June 07, 2016 7:50 PM<br>
                <b>To:</b> Haim Vana <a class="moz-txt-link-rfc2396E" href="mailto:haimv@perfectomobile.com">&lt;haimv@perfectomobile.com&gt;</a>;
                <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] Custom page for not
                found realm (tenant)<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">How exactly the error page looks like and
            how the browser URL looks like? Is it something in the
            server.log when it's displayed?<br>
            <br>
            Marek<br>
            <br>
            On 07/06/16 15:31, Haim Vana wrote:<span
              style="font-size:12.0pt"><o:p></o:p></span></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:#1F497D">Hi Marek,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">The exception
              (HTTP error 404) is on KeyCloak side (missing tenant), I
              have looked into the
              <a moz-do-not-send="true"
href="https://emea01.safelinks.protection.outlook.com/?url=http%3a%2f%2fkeycloak.github.io%2fdocs%2fuserguide%2fkeycloak-server%2fhtml_single%2findex.html%23themes&amp;data=01%7c01%7chaimv%40perfectomobile.com%7c626641da90b9484e5d2a08d38ef3c0fb%7cceb4c662d6994e7da0bd272619a46977%7c1&amp;sdata=Hii1VGckqpBLk1RNW94EvLMlZdazbCXatypIRAGhWk4%3d">themes</a>
               chapter and the <a moz-do-not-send="true"
href="https://emea01.safelinks.protection.outlook.com/?url=https%3a%2f%2fgithub.com%2fkeycloak%2fkeycloak%2ftree%2fmaster%2fexamples%2fthemes&amp;data=01%7c01%7chaimv%40perfectomobile.com%7c626641da90b9484e5d2a08d38ef3c0fb%7cceb4c662d6994e7da0bd272619a46977%7c1&amp;sdata=lo9wMO8BHKE%2fEZTR6J8FfKMuCyTEjBialzqOGq629LQ%3d">themes
                examples</a> but I didn't find a way to customize the
              missing tenant page (instead of the 404 that is thrown).</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Is it
              possible ?</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">We can’t do
              it in the web.xml since we want it to only for the missing
              tenant scenario.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Thanks,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Haim.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                  style="color:windowtext"> Marek Posolda [<a
                    moz-do-not-send="true"
                    href="mailto:mposolda@redhat.com"><a class="moz-txt-link-freetext" href="mailto:mposolda@redhat.com">mailto:mposolda@redhat.com</a></a>]
                  <br>
                  <b>Sent:</b> Tuesday, June 07, 2016 10:21 AM<br>
                  <b>To:</b> Haim Vana <a moz-do-not-send="true"
                    href="mailto:haimv@perfectomobile.com">&lt;haimv@perfectomobile.com&gt;</a>;
                  <a moz-do-not-send="true"
                    href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
                  <b>Subject:</b> Re: [keycloak-user] Custom page for
                  not found realm (tenant)</span><o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <div>
            <p class="MsoNormal">Is the error thrown on application side
              or on keycloak side? If it's on application side and you
              have servlet application, you can configure the custom
              error page in web.xml . For example see
              <a moz-do-not-send="true"
href="https://emea01.safelinks.protection.outlook.com/?url=https%3a%2f%2fwww.onehippo.org%2flibrary%2fconcepts%2ferror-pages-and-error-handling%2f1.-handling-error-codes-and-exceptions-by-the-web.xml.html&amp;data=01%7c01%7chaimv%40perfectomobile.com%7c5730227127a048fb870e08d38ea44dce%7cceb4c662d6994e7da0bd272619a46977%7c1&amp;sdata=K8cKlTEFcGnJbJJXSxYkLV5rS110wO5kW7yTKNuU5DU%3d">https://www.onehippo.org/library/concepts/error-pages-and-error-handling/1.-handling-error-codes-and-exceptions-by-the-web.xml.html</a>
              .<br>
              <br>
              If it's on keycloak side, you can change look&amp;feel of
              keycloak error pages with usage of custom theme. See the
              docs and our theme examples for more details.<br>
              <br>
              Marek<br>
              <br>
              <br>
              On 07/06/16 09:10, Haim Vana 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"> <o:p></o:p></p>
            <p class="MsoNormal">We are using KeyCloak with
              multi-tenancy, each realm represents a tenant (customer).<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Sometimes due to setup issue or typo in
              the realm name we are getting 404 page, is there a custom
              page or a way to customize a page for missing realm
              scenario ?<o:p></o:p></p>
            <p class="MsoNormal">For example something like – Realm
              &lt;name&gt; doesn't exist…<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">Haim.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal"><span
                style="font-size:12.0pt;font-family:&quot;Times New
                Roman ,serif&quot;,serif">The information contained in
                this message is proprietary to the sender, protected
                from disclosure, and may be privileged. The information
                is intended to be conveyed only to the designated
                recipient(s) of the message. If the reader of this
                message is not the intended recipient, you are hereby
                notified that any dissemination, use, distribution or
                copying of this communication is strictly prohibited and
                may be unlawful. If you have received this communication
                in error, please notify us immediately by replying to
                the message and deleting it from your computer. Thank
                you.
                <br>
                <br>
                <br>
                <br>
              </span><o:p></o:p></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://emea01.safelinks.protection.outlook.com/?url=https%3a%2f%2flists.jboss.org%2fmailman%2flistinfo%2fkeycloak-user&amp;data=01%7c01%7chaimv%40perfectomobile.com%7c5730227127a048fb870e08d38ea44dce%7cceb4c662d6994e7da0bd272619a46977%7c1&amp;sdata=dGJHvWU5BkL9%2fD9O%2fVX6TjrfG6geCDU9zsqVV8FgKiU%3d">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:&quot;Times New Roman
              ,serif&quot;,serif"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,serif">The information contained in this
              message is proprietary to the sender, protected from
              disclosure, and may be privileged. The information is
              intended to be conveyed only to the designated
              recipient(s) of the message. If the reader of this message
              is not the intended recipient, you are hereby notified
              that any dissemination, use, distribution or copying of
              this communication is strictly prohibited and may be
              unlawful. If you have received this communication in
              error, please notify us immediately by replying to the
              message and deleting it from your computer. Thank you.
              <o:p></o:p></span></p>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:&quot;Times New
            Roman&quot;,serif"><o:p> </o:p></span></p>
      </div>
      The information contained in this message is proprietary to the
      sender, protected from disclosure, and may be privileged. The
      information is intended to be conveyed only to the designated
      recipient(s) of the message. If the reader of this message is not
      the intended recipient, you are hereby notified that any
      dissemination, use, distribution or copying of this communication
      is strictly prohibited and may be unlawful. If you have received
      this communication in error, please notify us immediately by
      replying to the message and deleting it from your computer. Thank
      you.
    </blockquote>
    <br>
  </body>
</html>