No access to the protected media item - even though the user is within the correct Member Group
Hello, we recently purchased a license for the Media Protect product.
However, when testing it both on our Production and at localhost, the logged user within the correct Member Group is not able to access the protected media file.
Here is my setup:
Umbraco 8.17.1
MediaProtect 2.8.4
I have a protected folder with a media file within it - /media/lhrpougl/pdfsample.pdf
It is protected based on the member group – Standard members should be able to access it.
I log in the site with a user that is a member of the Standard group.
When I try to access the file - I am redirected to the login page
I created a sample macro to showcase the issue - it shows that it recognizes that the user is logged in has the correct group and according to the method MediaHasAccess() should be able to access the file, but still when I click on the link I get redirected to the login page:
@using MediaProtect.Library.TypeExtensions
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var mediaPath = "/media/lhrpougl/pdfsample.pdf";
}
<div>
<div>Is logged in: @Members.GetCurrentLoginStatus().IsLoggedIn</div>
<div>Email: @Members.GetCurrentLoginStatus().Email</div>
<div>Username: @Members.GetCurrentLoginStatus().Username</div>
<div>
User roles :
@foreach (var role in Roles.GetRolesForUser(Members.GetCurrentLoginStatus().Username))
{
<span>@role</span>
<br />
}
</div>
<div>Has access to <a target="_blank" href="@mediaPath">@mediaPath</a>: @Umbraco.MediaHasAccess(mediaPath)</div>
</div>
</div>
The result is :
Additional note: for login we integrate with Azure AD.
I would love to get some pointers on how to fix it or if there is something I am missing.
The current implementation of the authentication provider media protect uses was strict for Umbraco Membership. I've checked the source of Umbraco and the membershiphelper in your sample uses the standard asp.net membership provider So i think that changing the authenticationprovider in mediaprotect.config to MemberShipAuthentication should do the trick. If not please let me know.
Could be that my middleware is to early in the process. Haven't tested this on Azure AD but a mediaprotect provider is easy to implement. If you contact [email protected] I send you a sample.
No access to the protected media item - even though the user is within the correct Member Group
Hello, we recently purchased a license for the Media Protect product.
However, when testing it both on our Production and at localhost, the logged user within the correct Member Group is not able to access the protected media file.
Here is my setup: Umbraco 8.17.1 MediaProtect 2.8.4
I created a sample macro to showcase the issue - it shows that it recognizes that the user is logged in has the correct group and according to the method MediaHasAccess() should be able to access the file, but still when I click on the link I get redirected to the login page:
The result is :
Additional note: for login we integrate with Azure AD.
I would love to get some pointers on how to fix it or if there is something I am missing.
Regards, Boris.
Hi Boris,
The current implementation of the authentication provider media protect uses was strict for Umbraco Membership. I've checked the source of Umbraco and the membershiphelper in your sample uses the standard asp.net membership provider So i think that changing the authenticationprovider in mediaprotect.config to MemberShipAuthentication should do the trick. If not please let me know.
Best,
Richard
Hey Richard,
Thanks for the quick answer. Unfortunately the result is still the same.
I changed the authenticationprovider in mediaprotect.config to MemberShipAuthentication as you suggested - But it still redirects to the login page.
Best, Boris
Could be that my middleware is to early in the process. Haven't tested this on Azure AD but a mediaprotect provider is easy to implement. If you contact [email protected] I send you a sample.
Best,
Richard
is working on a reply...