aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-06 14:38:29 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-06 14:38:29 -0400
commit3538789e46d3332a2f20cd6b3db13b2aa9fbe475 (patch)
treec0c07f4912fc3c632ca38dc02053ff2108619b02 /MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
parenta529f07869f68918d07f607ca908f89f658236fb (diff)
Added User authentication
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs')
-rw-r--r--MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
new file mode 100644
index 000000000..0905016c4
--- /dev/null
+++ b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using MediaBrowser.Common.Net.Handlers;
+using MediaBrowser.Controller;
+using MediaBrowser.Model.DTO;
+using MediaBrowser.Model.Entities;
+
+namespace MediaBrowser.Api.HttpHandlers
+{
+ class UserAuthenticationHandler : BaseSerializationHandler<AuthenticationResult>
+ {
+ protected override async Task<AuthenticationResult> GetObjectToSerialize()
+ {
+ Guid userId = Guid.Parse(QueryString["userid"]);
+ User user = Kernel.Instance.Users.First(u => u.Id == userId);
+
+ string password = await GetFormValue("password").ConfigureAwait(false);
+
+ AuthenticationResult result = new AuthenticationResult()
+ {
+ Success = true
+ };
+
+ return result;
+ }
+ }
+}