diff --git a/src/Ombi.Core/Authentication/OmbiUserManager.cs b/src/Ombi.Core/Authentication/OmbiUserManager.cs index 87f82c1de..0ac9bacf9 100644 --- a/src/Ombi.Core/Authentication/OmbiUserManager.cs +++ b/src/Ombi.Core/Authentication/OmbiUserManager.cs @@ -52,7 +52,7 @@ namespace Ombi.Core.Authentication IdentityErrorDescriber errors, IServiceProvider services, ILogger> logger, IPlexApi plexApi, IEmbyApiFactory embyApi, ISettingsService embySettings, IJellyfinApiFactory jellyfinApi, ISettingsService jellyfinSettings, - ISettingsService auth) + ISettingsService auth, ISettingsService cfauth) : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger) { _plexApi = plexApi; diff --git a/src/Ombi.Settings/Settings/Models/AuthenticationSettings.cs b/src/Ombi.Settings/Settings/Models/AuthenticationSettings.cs index f6736e7c5..11c736b0b 100644 --- a/src/Ombi.Settings/Settings/Models/AuthenticationSettings.cs +++ b/src/Ombi.Settings/Settings/Models/AuthenticationSettings.cs @@ -13,5 +13,6 @@ namespace Ombi.Settings.Settings.Models public bool RequireNonAlphanumeric { get; set; } public bool RequireUppercase { get; set; } public bool EnableOAuth { get; set; } // Plex OAuth + public bool EnableCloudflareAccess { get; set; } } } \ No newline at end of file diff --git a/src/Ombi.Settings/Settings/Models/CloudflareSettings.cs b/src/Ombi.Settings/Settings/Models/CloudflareSettings.cs new file mode 100644 index 000000000..db11f7ff6 --- /dev/null +++ b/src/Ombi.Settings/Settings/Models/CloudflareSettings.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace Ombi.Settings.Settings.Models +{ + public class CloudflareAuthenticationSettings : Settings + { + public string issuer { get; set; } + public string audience { get; set; } + public string certlink { get; set; } + } +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/auth/auth.service.ts b/src/Ombi/ClientApp/src/app/auth/auth.service.ts index afc0a2491..d7d182c8c 100644 --- a/src/Ombi/ClientApp/src/app/auth/auth.service.ts +++ b/src/Ombi/ClientApp/src/app/auth/auth.service.ts @@ -28,6 +28,10 @@ export class AuthService extends ServiceHelpers { return this.http.post(`${this.url}/requirePassword`, JSON.stringify(login), { headers: this.headers }); } + public attemptCF(): Observable { + return this.http.get(`${this.url}/cfAuth`); + } + public getToken() { return this.jwtHelperService.tokenGetter(); } diff --git a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts index 083425deb..311b8ac5f 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts @@ -230,6 +230,13 @@ export interface IAuthenticationSettings extends ISettings { requireNonAlphanumeric: boolean; requireUppercase: boolean; enableOAuth: boolean; + enableCloudflareAccess: boolean; +} + +export interface ICloudflareSettings extends ISettings { + issuer: string; + audience: string; + certlink: string; } export interface ICustomPage extends ISettings { diff --git a/src/Ombi/ClientApp/src/app/login/login.component.html b/src/Ombi/ClientApp/src/app/login/login.component.html index c0932999b..6663cdf88 100644 --- a/src/Ombi/ClientApp/src/app/login/login.component.html +++ b/src/Ombi/ClientApp/src/app/login/login.component.html @@ -9,7 +9,7 @@

OMBI

{{customizationSettings.applicationName}}

- + -