unsupported_grant_type

unsupported_grant_type

חברים יקרים, אשמח לעזרה.
אני משתמש ב-MVC 5 WebApi. אני עושה לוגין ואני מקבל unsupported_grant_type.
עברתי על עשרות תשובות ברשת וכולם אומרים אותו דבר להוסיף ל-headers את ההגדרה הזו: 'Content-Type': 'application/x-www-form-urlencoded'. ניסיתי וזה עדיין לא עובד.
ניסיתי גם להוסיף 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
אני מנסה לראות בקוד לאן הוא מגיע בשרת ואני רואה שהוא מגיע לפונקציה הזו ValidateClientAuthentication בתוך המחלקה ApplicationOAuthProvider.
הוא לא נכנס לפונקציה GrantResourceOwnerCredentials.
זה קוד ה-JS
var loginData = { grant_type:"password",
username: encodeURIComponent(that.input.username),
password: encodeURIComponent(that.input.password),};$http({ method: 'POST', url: '/Token', data: loginData, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },}).success(function (data, status, headers, config) { console.log(data, status, headers, config);}).error(function (data, status, headers, config) { console.log(data, status, headers, config);});
 
הבעיה היא באנגולר

או ליתר דיוק באיך שהאנגולר בונה את קריאת ה-HTTP.
הרצתי את זה עם JQuery וזה עובד מעולה.
הנה קוד הJQuery. אני לא רואה הבדל. (את האנגולר הרצתי גם בלי ה-headers, כך שאל תתלו את זה בהבדל של ה-headrers).
var loginData = { grant_type:"password",
username: encodeURIComponent(that.input.username),
password: encodeURIComponent(that.input.password),
};
var jqxhr = $.post('/Token', loginData).done(function () { console.log("success", arguments);}).fail(function () { console.log("error", arguments);}).always(function () { console.log("finished", arguments);});
 
למעלה