Intercepting all media requests for authentication and authorization
Hello Community,
Greetings! :)
My currently project requires us to make selected media items under authentication and authoirization as to match Umbraco membership group access as in content section.
This guides us to create a route for "/media/" to a controller and processing a request but this is only called when file link is clicked,
ie Click here .
This works well in case of pdf, xls, doc, etc but not for jpg, png but does not match our requirements.
This is what we are targeting to having a MemberGroup picker on File, Folder and Image MediaType. Once we select a group(s) on the media or media folder, every children will be considered as restricted and should be only allowed to that MemberGroup.
I tried writing IHttpModule to process all request (on loading the DOM) but only intercepts the main request and couple of other that include ping.aspx, etc
I am trying to find a way a intercept all requests for images(jpg, png, etc) and documents(pdf and ms office) that comes from media section i.e. ("/media/").
I understand there are couple of paid packages like MediaProtect. But it would be a great to implement this feature on my own. Of course with some help from community.
Intercepting all media requests for authentication and authorization
Hello Community,
Greetings! :)
My currently project requires us to make selected media items under authentication and authoirization as to match Umbraco membership group access as in content section.
I did look in to following URL: https://martincarlsen.com/securing-media-files-in-umbraco/
This guides us to create a route for "/media/" to a controller and processing a request but this is only called when file link is clicked, ie Click here .
This works well in case of pdf, xls, doc, etc but not for jpg, png but does not match our requirements.
This is what we are targeting to having a MemberGroup picker on File, Folder and Image MediaType. Once we select a group(s) on the media or media folder, every children will be considered as restricted and should be only allowed to that MemberGroup.
I tried writing IHttpModule to process all request (on loading the DOM) but only intercepts the main request and couple of other that include ping.aspx, etc
I am trying to find a way a intercept all requests for images(jpg, png, etc) and documents(pdf and ms office) that comes from media section i.e. ("/media/").
I understand there are couple of paid packages like MediaProtect. But it would be a great to implement this feature on my own. Of course with some help from community.
Please advice!
Thank you in advance!
Best Regards,
Ranjit J. Vaity
Hi Ranjit,
I would suggest using Media Protect : https://our.umbraco.org/projects/website-utilities/media-protect/
Building something like that will require a lot of time.
Dave
is working on a reply...