<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      the question is why you need Direct Grant Access in javascript
      application? I think it will be much better to use our javascript
      adapter and retrieve the access token with it:
<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 7.4.2015 10:24, Sadiq Khoja wrote:<br>
    </div>
    <blockquote
cite="mid:CAK2HbcydC=gd0RbMUz6LoJkmBhPJZXX5E=ZRcTxJpZtCP5Mf2w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:verdana,sans-serif;color:rgb(153,51,0)">Guys,</div>
        <div class="gmail_default"
          style="font-family:verdana,sans-serif;color:rgb(153,51,0)"><br>
        </div>
        <div class="gmail_default" style=""><font color="#993300"
            face="verdana, sans-serif">I want to enable CORS for Direct
            Grant Access, how to do it? I am getting following error
            from my javascript application:</font><br>
          <font color="#993300" face="verdana, sans-serif"><br>
          </font></div>
        <div class="gmail_default" style=""><font color="#993300"
            face="verdana, sans-serif">(index):1 XMLHttpRequest cannot
            load <a moz-do-not-send="true"
              href="http://localhost:8080/auth/realms/master/tokens/grants/access">http://localhost:8080/auth/realms/master/tokens/grants/access</a>.
            No 'Access-Control-Allow-Origin' header is present on the
            requested resource. Origin '<a moz-do-not-send="true"
              href="http://pn.localhost:81">http://pn.localhost:81</a>'
            is therefore not allowed access. The response had HTTP
            status code 400.</font><br>
        </div>
        <div class="gmail_default" style=""><font color="#993300"
            face="verdana, sans-serif"><br>
          </font></div>
        <div class="gmail_default" style=""><font color="#993300"
            face="verdana, sans-serif"><br>
          </font></div>
        <div>
          <div class="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div style="font-family:arial;font-size:small"><span
                      style="color:rgb(153,51,0);font-family:verdana,sans-serif">
                      <div style="display:inline">​</div>
                      Regards,</span><br
                      style="color:rgb(153,51,0);font-family:verdana,sans-serif">
                    <span
                      style="color:rgb(153,51,0);font-family:verdana,sans-serif"><b>
                        <div style="display:inline">​​</div>
                        Sadiq Khoja</b></span></div>
                  <div style="font-family:arial;font-size:small">
                    <div
                      style="font-family:verdana,sans-serif;color:rgb(153,51,0)"><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </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>