Access-Control-Allow-Origin: "http://subdomain.domain.tld"
Access-Control-Allow-Methods: "GET"
Access-Control-Allow-Credentials: "true"
Access-Control-Allow-Headers: "X-Requested-With"
$.ajax
url: kodi.config.user_db
xhrFields: {'withCredentials': true}
success: (ctx) =>
return true if ctx.username is not null
No, unfortunately. instead i send the user's browser to the underlying server i'm trying to get data from. this makes the browser pop an http basic auth dialog. the user fills this in and is then redirected back to the site from which he came. this works because the browser remembers basic auth credentials until the browser is closed. so for example, user lands at http://xyz.com. the html/js/css served from xyz.com is trying to make get/post/update/delete requests to http://abc.com. on the first attempt, the user is sent to http://abc.com/login. after successful login, user is sent back to http://xyz.com and has to redo his previous request.
don't really like it, but it works...