Blog Portfolio Components Sitefinity
Contact
Blog Portfolio Components Sitefinity
Published on
Tuesday, November 11th 2014

Redirect to protected document after login

Authors
  • Twitter Avatar
    Name
    Steve McNiven
    Twitter
    @stevemcniven

Media content in Sitefinity can be permissioned, which is great.  However in an unauthenticated state if the user clicks a link to the file from either an email link, or on the site somewhere they get a 401 response, not a link to your login page with a passthrough to the file.

Here’s how you can get around that…

Step 1: Detect the error

Basically all we’re doing here is capturing any error message related to documents so we can manually send them to the login page.

Step 2: Create the page\widget to serve the file

So this could be an aspx page, ascx control, mvc control, simpleview widget…doesn’t matter.  You just need something to serve them up the file.  I mean it’s probably a better idea for this to be a sitefinity page that can be permissioned with a widget on it.  This code is just something we did a long time ago…

That’s it!..next step is for telerik to get to making the functionality native without modification…or at least the ability to enable it.

Next Article

Is Sitefinity not evangalizable?

Previous Article

Sitefinity 7.1s new multi-widget module system

Top Posts

  • Kendo Grid: cannot read property data of undefined
  • Avoid Version errors with Assembly Binding
  • Remote certificate is invalid error
  • Sitefinity forms popup template
  • Angular widgets in Sitefinity
  • Testing functionality with cypress.io
  • Supercharge Sitefinity load times with Roslyn
← Back to the blog

Boost your online presence.

Let us create the perfect digital experience for your company.

Contact us now
Twitter GitHub LinkedIn

© 2022 Sitefinity Steve. All rights reserved. XS SM MD LG XL