瀏覽代碼

Authentication tweaks

LukePulverenti Luke Pulverenti luke pulverenti 13 年之前
父節點
當前提交
b12da143d1

+ 1 - 1
MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs

@@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers
     {
         protected override async Task<AuthenticationResult> GetObjectToSerialize()
         {
-            Guid userId = Guid.Parse(await GetFormValue("userId").ConfigureAwait(false));
+            Guid userId = Guid.Parse(await GetFormValue("userid").ConfigureAwait(false));
             User user = Kernel.Instance.Users.First(u => u.Id == userId);
 
             string password = await GetFormValue("password").ConfigureAwait(false);

+ 2 - 2
MediaBrowser.ApiInteraction/ApiClient.cs

@@ -654,9 +654,9 @@ namespace MediaBrowser.ApiInteraction
         /// </summary>
         public async Task<AuthenticationResult> AuthenticateUser(Guid userId, string password)
         {
-            string url = ApiUrl + "/UserAuthentication?userId=" + userId;
-            url += "&dataformat=" + SerializationFormat.ToString();
+            string url = ApiUrl + "/UserAuthentication?dataformat=" + SerializationFormat.ToString();
 
+            // Create the post body
             string postContent = string.Format("userid={0}&password={1}", userId, password);
 
             HttpContent content = new StringContent(postContent, Encoding.UTF8, "application/x-www-form-urlencoded");