aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Authentication
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Authentication')
-rw-r--r--MediaBrowser.Controller/Authentication/AuthenticationResult.cs14
-rw-r--r--MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs35
2 files changed, 49 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Authentication/AuthenticationResult.cs b/MediaBrowser.Controller/Authentication/AuthenticationResult.cs
new file mode 100644
index 000000000..6dd8f02d8
--- /dev/null
+++ b/MediaBrowser.Controller/Authentication/AuthenticationResult.cs
@@ -0,0 +1,14 @@
+using MediaBrowser.Controller.Session;
+using MediaBrowser.Model.Dto;
+
+
+namespace MediaBrowser.Controller.Authentication
+{
+ public class AuthenticationResult
+ {
+ public UserDto User { get; set; }
+ public SessionInfo SessionInfo { get; set; }
+ public string AccessToken { get; set; }
+ public string ServerId { get; set; }
+ }
+}
diff --git a/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs b/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs
new file mode 100644
index 000000000..becb3ea62
--- /dev/null
+++ b/MediaBrowser.Controller/Authentication/IAuthenticationProvider.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Model.Users;
+
+namespace MediaBrowser.Controller.Authentication
+{
+ public interface IAuthenticationProvider
+ {
+ string Name { get; }
+ bool IsEnabled { get; }
+ Task<ProviderAuthenticationResult> Authenticate(string username, string password);
+ Task<bool> HasPassword(User user);
+ Task ChangePassword(User user, string newPassword);
+ }
+
+ public interface IRequiresResolvedUser
+ {
+ Task<ProviderAuthenticationResult> Authenticate(string username, string password, User resolvedUser);
+ }
+
+ public interface IHasNewUserPolicy
+ {
+ UserPolicy GetNewUserPolicy();
+ }
+
+ public class ProviderAuthenticationResult
+ {
+ public string Username { get; set; }
+ public string DisplayName { get; set; }
+ }
+}