From b12da143d1e8a319e4b7309ab9240b603b544e18 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 6 Sep 2012 14:50:16 -0400 Subject: [PATCH] Authentication tweaks --- MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs | 2 +- MediaBrowser.ApiInteraction/ApiClient.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs index c0ee2ff0eb..ed588e7762 100644 --- a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers { protected override async Task 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); diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index f8c0dc761b..ca53c66fcd 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -654,9 +654,9 @@ namespace MediaBrowser.ApiInteraction /// public async Task 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");