Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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:
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:
var mediaPath = "/media/lhrpougl/pdfsample.pdf";
<div>Is logged in: @Members.GetCurrentLoginStatus().IsLoggedIn</div>
User roles :
@foreach (var role in Roles.GetRolesForUser(Members.GetCurrentLoginStatus().Username))
<div>Has access to <a target="_blank" href="@mediaPath">@mediaPath</a>: @Umbraco.MediaHasAccess(mediaPath)</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.
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.
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted