JWT Query Parameter Auth for IPTV Links (#1215)
* JWT Auth * Standardized url variable additions * formatting and minor refactoring * this isn't needed * allow channel logos without auth * update changelog --------- Co-authored-by: Ministorm3 <4474921+Ministorm3@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.Text;
|
||||
|
||||
namespace ErsatzTV;
|
||||
|
||||
public static class JwtHelper
|
||||
{
|
||||
public static void Init(IConfiguration configuration)
|
||||
{
|
||||
string issuerSigningKey = configuration["JWT:IssuerSigningKey"];
|
||||
IsEnabled = !string.IsNullOrWhiteSpace(issuerSigningKey);
|
||||
if (IsEnabled)
|
||||
{
|
||||
IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(issuerSigningKey!));
|
||||
}
|
||||
}
|
||||
|
||||
public static SymmetricSecurityKey IssuerSigningKey { get; private set; }
|
||||
public static bool IsEnabled { get; private set; }
|
||||
}
|
||||
Reference in New Issue
Block a user