XMLHttpRequest in Chrome Extension with HTTP Authorization continues to send Authorization Header on regular pages

596 views
Skip to first unread message

Ben

unread,
Jul 6, 2011, 12:36:26 PM7/6/11
to Chromium-extensions
Posted on stackoverflow as well:
http://stackoverflow.com/questions/6598895/xmlhttprequest-in-chrome-extension-with-http-authorization-continues-to-send-auth

I am working on a chrome extension that works with the Basecamp API.

I have a background page doing all my XMLHttpRequests to the API. I'm
not using OAuth, but the basic HTTP Authorization with the API Token.

In my background page, I will do requests like this:

var xmlReq = new XMLHttpRequest();
xmlReq.onreadystatechange = function()
{ doSomething(xmlReq.responseXML); };

xmlReq.open(
'GET',
'https://mycompany.basecamphq.com/projects.xml',
true,
access_token,
'x'
);

xmlReq.send(null);

That all works fine, but the problem is after I use the extension to
make a request, the HTTP Request header Authorization is being sent
whenever I browse to https://mycompany.basecamphq.com, which make
certain things not work on Basecamp's web interface. How can I make a
request in my extension with basic HTTP Authorization but not have the
header in my regular browser requests?

Yeah, confusing question. I'll try to clarify it if you have
questions. Thanks

Boris Smus

unread,
Jul 8, 2011, 11:57:15 AM7/8/11
to Ben, Chromium-extensions
Hi Ben,

Sounds like you've figured it out, setting the "Authorization: Basic <base64>" header manually in order to pass credentials. Sorry for the delay in moderating your post.

- Boris


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Reply all
Reply to author
Forward
0 new messages