We need to provide this functionality in keycloak.js so you don't have
to do it.
On 2/26/2015 11:05 AM, Christopher Wallace wrote:
I was able to SUCCESSFULLY obtain the JSON user information using
the
following javascript:
var keycloak = Keycloak('http://localhost:8080/app/keycloak.json');
var loadData = function () {
console.log(keycloak.tokenParsed);
var user = JSON.stringify(keycloak.tokenParsed);
console.log(user);
};
var loadFailure = function () {
console.log('<b>Failed to load data. Check console
log</b>');
};
var reloadData = function () {
keycloak.updateToken(10)
.success(loadData)
.error(function() {
console.log('<b>Failed to load data. User is logged
out.</b>');
});
};
keycloak.init({ onLoad: 'login-required' }).success(reloadData);
}, null, this);
On Thu, Feb 26, 2015 at 10:21 AM, Christopher Wallace
<cjwallac(a)gmail.com <mailto:cjwallac@gmail.com>> wrote:
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:
XMLHttpRequest cannot load
http://localhost:8082/database/customers.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost:8080' is therefore not allowed
access. The response had HTTP status code 405.
I have CORS working for authentication from
http://localhost:8080 is
there a different place to allow this origin?
for /database/customers outside of the application inside of the
realm I have defined?
--
Chris Wallace
cjwallac(a)gmail.com <mailto:cjwallac@gmail.com>
--
Chris Wallace
cjwallac(a)gmail.com <mailto:cjwallac@gmail.com>
c: 570.582.9955
_______________________________________________
keycloak-user mailing list
keycloak-user(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user