Bug Tracker

Opened 8 years ago

Closed 7 years ago

#11364 closed bug (invalid)

ajax Basic Authentification does not seem to work in latest Chrome nightlies

Reported by: 343max Owned by:
Priority: low Milestone: None
Component: ajax Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

This test:

	$.ajax(tabulatabsServerPath + 'hello/hello_secure.json', {
		type: 'GET',
		username: 'Tester',
		password: 'greets',
		success: function(r) {
			equal(r.greeted, 'Hello Tester!', 'authentification is working');
			start();
		}
	});

always returns 401 not authorized in the latest Chrome Betas/Chrome Canries

I could fix it by manually setting the Authorization request header in the beforeSend callback:

	$.ajax(tabulatabsServerPath + 'hello/hello_secure.json', {
		type: 'GET',
		username: 'Tester',
		password: 'greets',
		beforeSend: function(jqXHR, settings) {
			if (settings.username) {
				jqXHR.setRequestHeader('Authorization', 'Basic ' + base64_encode(settings.username + ':' + settings.password) + '==');
			}
		},
		success: function(r) {
			equal(r.greeted, 'Hello Tester!', 'authentification is working');
			start();
		}
	});

Change History (3)

comment:1 Changed 8 years ago by jaubourg

You should create a ticket against webkit or chrome just to make sure this change is intended. If it is, then we'll proceed into adding yet another browser-specific trick.

comment:2 Changed 8 years ago by addyosmani

Component: unfiledajax
Priority: undecidedlow
Status: newopen

comment:3 Changed 7 years ago by dmethvin

Resolution: invalid
Status: openclosed

Since we haven't heard more about this I will assume it was a Chrome bug that got fixed before it was released.

Note: See TracTickets for help on using tickets.