using MediaBrowser.Model.Plugins;
namespace Jellyfin.Plugin.Keycloak.Configuration;
///
/// The main plugin.
///
public class PluginConfiguration : BasePluginConfiguration
{
///
/// Initializes a new instance of the class.
///
public PluginConfiguration()
{
// set default options here
this.Enabled = false;
this.CreateUser = true;
this.Enable2Fa = false;
this.AuthServerUrl = string.Empty;
this.Realm = "master";
this.ClientId = string.Empty;
this.ClientSecret = string.Empty;
this.OAuthScope = string.Empty;
this.RolesTokenAttribute = string.Empty;
this.UsernameTokenAttribute = "preferred_username";
this.EnableAllFolders = false;
this.EnabledFolders = System.Array.Empty();
}
///
/// Gets or sets a value indicating whether Keycloak authentication is enabled.
///
public bool Enabled { get; set; }
///
/// Gets or sets a value indicating whether creation of new users that dont exist in Jellyfin is enabled.
///
public bool CreateUser { get; set; }
///
/// Gets or sets a value indicating whether 2-factor authentication (Password+TOTP).
///
public bool Enable2Fa { get; set; }
///
/// Gets or sets Keycloak server URL.
///
public string AuthServerUrl { get; set; }
///
/// Gets or sets Keycloak server realm.
///
public string Realm { get; set; }
///
/// Gets or sets Keycloak client ID.
///
public string ClientId { get; set; }
///
/// Gets or sets Keycloak client secret.
///
public string ClientSecret { get; set; }
///
/// Gets or sets Keycloak OAuth scope.
///
public string OAuthScope { get; set; }
///
/// Gets or sets Keycloak username token attribute.
///
public string UsernameTokenAttribute { get; set; }
///
/// Gets or sets Keycloak roles token attribute.
///
public string RolesTokenAttribute { get; set; }
///
/// Gets or sets a value indicating whether users without a role are allowed to log in.
///
public bool AllowUsersWithoutRole { get; set; }
///
/// Gets or sets a value indicating whether to enable access to all library folders.
///
public bool EnableAllFolders { get; set; }
///
/// Gets or sets a list of folder Ids which are enabled for access by default.
///
public string[] EnabledFolders { get; set; }
}