Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ranjit J. Vaity 66 posts 109 karma points
    Mar 30, 2018 @ 12:18
    Ranjit J. Vaity
    0

    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

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 06, 2018 @ 09:31
    Dave Woestenborghs
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies