I'm currently trying to retrieve videos from a private Dailymotion channel in my personal application.
To do that I'm trying to authenticate to the Dailymotion API using the grant_type method : password.
Here is my POST request :
xhr.open('POST', 'https://api.dailymotion.com/oauth/token', true);
xhr.setRequestHeader('Content-Type', 'multipart/form-data');
xhr.onload = function(e) {
console.log("HEADERS", e.target.getAllResponseHeaders())
if (e.target.status < 400) {
console.log(e);
} else {
console.log("error")
}
};
xhr.onerror = function(e) {
console.log("HEADERS", e.target.getAllResponseHeaders())
};
xhr.send('grant_type=password&client_id=<MyAPIKey>&client_secret=<MyAPISecret>&username=<MyUserName>&password=<MyPassword>');
I'm receiving the following error : No 'Access-Control-Allow-Origin' header is present on the requested resource.
I checked the response header and the Access-Control-Allow-Origin is missing. I cannot add this parameter on the API server because I'm requesting Dailymotion servers...
So my question is : Is it possible to configure the Dailymotion application (referenced by my API Key) to accept my request from my private domain, or is there a way to bypass the 'Access-Control-Allow-Origin' problem.
Thanks in advance !