2

I'm using AJAX to make call, withCredentials = true, to IdP service. It returns response message with form which redirects to another URL. Only in Google chrome, it prompts for credential in which I assume 401 is received, but I want it to fail, instead of prompting for credential.

I've tried exact same codes in Edge, and it does fail with 401 status. No credential prompt. Also, some stackoverflow seems to hint that WWW-Authenticate needs to be removed or hacked, but that seems to mess-up built-in credential negotiate already in place (OOTB).

Following is a snippet used in both browsers (Edge & Chrome)

$.ajax({
        type: form.method,
        url: form.action,
        data: formData,
        xhrFields: {
            withCredentials: true
        },
        success: function(result) {
            // Do something
        },
        error: function(xhr, status, exception) {
            // Do something
        }
    });

Expected: In Chrome, it should not display credential prompt.

Actual: Chrome displays credential prompt.

jkim
  • 152
  • 1
  • 3
  • 15

0 Answers0