Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AJAX XHR support for Basic Auth #44

Open
clvgt12 opened this issue Nov 13, 2015 · 0 comments
Open

AJAX XHR support for Basic Auth #44

clvgt12 opened this issue Nov 13, 2015 · 0 comments

Comments

@clvgt12
Copy link

clvgt12 commented Nov 13, 2015

Hi,

Does the current API support Basic Authentication using AJAX and XMLHttpRequest() calls ?

I am attempting this with javascript inside the Firefox browser:

function SendAPI(username,passwd,api) {
var req=new XMLHttpRequest();
req.onreadystatechange=onReadyStateChangeHandler();
console.log("SendAPI: GET:"+api);
req.open("GET", api, true, username, passwd);
req.send(null);
return(req.responseText);
}

What I see on Firefox's javascript console is this:

SendAPI: GET:https://api.del.icio.us/v1/posts/recent
NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

Why is the API call denied ? Is it the way I am calling the API with XHR ?

I have successfully made API calls with Basic Auth using curl from bash. So I know Basic Auth is supported. By why the rejection with XHR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant