Hi
Since MediaPortal experimental IPTV filter can't handle authentication I like would like to propose the following feature:
Disable Authentication for Streaming
- when a stream is requested ex http://xxx.xxx.xx:8080/Stream/TV?item=1012&transcoder=IPTV
- Check if authentication for streaming is disabled
- if disabled begin streaming
- else redirect to login page (normal behavior)
Requires only changes to 3 files:
Changes:
Since MediaPortal experimental IPTV filter can't handle authentication I like would like to propose the following feature:
Disable Authentication for Streaming
- when a stream is requested ex http://xxx.xxx.xx:8080/Stream/TV?item=1012&transcoder=IPTV
- Check if authentication for streaming is disabled
- if disabled begin streaming
- else redirect to login page (normal behavior)
Requires only changes to 3 files:
Changes:
Code:
.../Controllers/StreamController.cs | 4 ++++
Config/Authentication.xml | 2 +-
.../Authentication.cs | 2 ++
3 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/Applications/MPExtended.Applications.WebMediaPortal/Controllers/StreamController.cs b/Applications/MPExtended.Applications.WebMediaPortal/Controllers/StreamController.cs
index 1c4adaa..40cff28 100644
--- a/Applications/MPExtended.Applications.WebMediaPortal/Controllers/StreamController.cs
+++ b/Applications/MPExtended.Applications.WebMediaPortal/Controllers/StreamController.cs
@@ -86,6 +86,10 @@ public class StreamController : BaseController
protected bool IsUserAuthenticated()
{
+ // No authentication for streaming
+ if (!Configuration.Authentication.Streaming)
+ return true;
+
if (PlayerOpenedBy.Contains(Request.UserHostAddress) || User.Identity.IsAuthenticated)
return true;
diff --git a/Config/Authentication.xml b/Config/Authentication.xml
index a602bf4..6ada6c7 100644
--- a/Config/Authentication.xml
+++ b/Config/Authentication.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Authentication xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://mpextended.github.com/schema/config/Users/1">
<Enabled>true</Enabled>
-
+ <Streaming>true</Streaming>
<Users>
<User>
<Username>admin</Username>
diff --git a/Libraries/MPExtended.Libraries.Service.Config/Authentication.cs b/Libraries/MPExtended.Libraries.Service.Config/Authentication.cs
index 9306ab4..147ef9d 100644
--- a/Libraries/MPExtended.Libraries.Service.Config/Authentication.cs
+++ b/Libraries/MPExtended.Libraries.Service.Config/Authentication.cs
@@ -57,6 +57,8 @@ public class Authentication
{
public bool Enabled { get; set; }
+ public bool Streaming { get; set; }
+
[XmlArray(Namespace = "http://mpextended.github.com/schema/config/Users/1", ElementName = "Users")]
[XmlArrayItem(ElementName = "User")]
public List<User> Users { get; set; }