OpenID Connect SSO for Jellyfin 10.10 (net8.0). Authorization code flow with PKCE via IdentityModel.OidcClient, automatic user creation with random password, role based admin/access mapping, plugin repo manifest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Jellyfin.Plugin.OidcAuth.Configuration;
|
|
using MediaBrowser.Common.Configuration;
|
|
using MediaBrowser.Common.Plugins;
|
|
using MediaBrowser.Model.Plugins;
|
|
using MediaBrowser.Model.Serialization;
|
|
|
|
namespace Jellyfin.Plugin.OidcAuth;
|
|
|
|
/// <summary>
|
|
/// The OIDC authentication plugin.
|
|
/// </summary>
|
|
public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="Plugin"/> class.
|
|
/// </summary>
|
|
/// <param name="applicationPaths">Instance of the <see cref="IApplicationPaths"/> interface.</param>
|
|
/// <param name="xmlSerializer">Instance of the <see cref="IXmlSerializer"/> interface.</param>
|
|
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
|
|
: base(applicationPaths, xmlSerializer)
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the current plugin instance.
|
|
/// </summary>
|
|
public static Plugin? Instance { get; private set; }
|
|
|
|
/// <inheritdoc />
|
|
public override string Name => "OIDC Auth";
|
|
|
|
/// <inheritdoc />
|
|
public override Guid Id => Guid.Parse("96badb44-9940-4ff0-befc-5f987159152c");
|
|
|
|
/// <inheritdoc />
|
|
public override string Description => "Log in to Jellyfin with an OpenID Connect provider.";
|
|
|
|
/// <inheritdoc />
|
|
public IEnumerable<PluginPageInfo> GetPages()
|
|
{
|
|
return new[]
|
|
{
|
|
new PluginPageInfo
|
|
{
|
|
Name = "OidcAuth",
|
|
EmbeddedResourcePath = GetType().Namespace + ".Configuration.configPage.html"
|
|
}
|
|
};
|
|
}
|
|
}
|