אוהב להתווכח
New member
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
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);});
חברים יקרים, אשמח לעזרה.
אני משתמש ב-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);});