<div dir="ltr">I was able to SUCCESSFULLY obtain the JSON user information using the following javascript:<div><div> var keycloak = Keycloak('<a href="http://localhost:8080/app/keycloak.json'">http://localhost:8080/app/keycloak.json'</a>);</div><div> </div><div> var loadData = function () {</div><div> </div><div> console.log(keycloak.tokenParsed);</div><div> var user = JSON.stringify(keycloak.tokenParsed);</div><div> console.log(user);</div><div> </div><div> };</div><div><br></div><div> var loadFailure = function () {</div><div> console.log('<b>Failed to load data. Check console log</b>');</div><div> };</div><div><br></div><div> var reloadData = function () {</div><div> keycloak.updateToken(10)</div><div> .success(loadData)</div><div> .error(function() {</div><div> console.log('<b>Failed to load data. User is logged out.</b>');</div><div> });</div><div> };</div><div><br></div><div> keycloak.init({ onLoad: 'login-required' }).success(reloadData);</div><div>}, null, this);</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 26, 2015 at 10:21 AM, Christopher Wallace <span dir="ltr"><<a href="mailto:cjwallac@gmail.com" target="_blank">cjwallac@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am attempted to use the Javascript Adapter I think I have the javascript correct, but when I go to pu the request to /database/customers I get:<div><br></div><div>XMLHttpRequest cannot load <a href="http://localhost:8082/database/customers" target="_blank">http://localhost:8082/database/customers</a>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:8080" target="_blank">http://localhost:8080</a>' is therefore not allowed access. The response had HTTP status code 405.</div><div><br></div><div>I have CORS working for authentication from <a href="http://localhost:8080" target="_blank">http://localhost:8080</a> is there a different place to allow this origin? for /database/customers outside of the application inside of the realm I have defined?<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div>Chris Wallace<br><a href="mailto:cjwallac@gmail.com" target="_blank">cjwallac@gmail.com</a><br></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Chris Wallace<br><a href="mailto:cjwallac@gmail.com" target="_blank">cjwallac@gmail.com</a><br>c: 570.582.9955<br></div>
</div>