|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Going to a link but need to log in.I am going to put up a website with documents where we give our customers a
link to go directly to the document. For safety purposed, I'm going to do Forms Authentication. The question I have though is if I give somebody a link to www.itsme.com/WinningLottoNumbers.pdf, it will force them to log in, just like it should. But once I am done having them log in, how can I direct the system to WinningLottoNumber.pdf? I don't want them to have to log in and then do the link again. Thanks for your help. Jeff. "Mr.Magic" <Muf***@NoWhere.Com> wrote in AFAIK, setting up forms authentication is all you have to do to get this news:u9EZPIAAKHA.4432@TK2MSFTNGP05.phx.gbl: > I am going to put up a website with documents where we give our > customers a link to go directly to the document. For safety purposed, > I'm going to do Forms Authentication. The question I have though is if > I give somebody a link to www.itsme.com/WinningLottoNumbers.pdf, it > will force them to log in, just like it should. But once I am done > having them log in, how can I direct the system to > WinningLottoNumber.pdf? I don't want them to have to log in and then > do the link again. going. You may have to register the MIME type in IIS, but that should be done with newer versions of IIS already. I have not tested this, but the normal ASP.NET login should work with PDF files. If it will not automatically redirect, you can use the redirect method back to the PDF file. It should not force the person to re-login unless the file itself does not give proper permissions to the ASP.NET account. This can happen if you move rather than copy files from another directory where the permissions are locked down. I posted a blog entry on permissions today: http://snurl.com/mdbhl -- Show quoteHide quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA Twitter: @gbworld Blog: http://gregorybeamer.spaces.live.com ******************************************* | Think outside the box! | ******************************************* If you are using Forms Authentication, then you can just call the static
method: FormsAuthentication.RedirectFromLoginPage() However, please note that your assumption that a request for http://mydomain.com/myfile.pdf will cause Forms Authentication to automatically kick in in incorrect! Under fedault IIS settings, the PDF file will be server by IIS natively, and ASP.NET pipeline will not be used, so your authentication code will never take place. (Please see various documentation available on how to resolvethis case.) Thanks, Muj Beg Show quoteHide quote "Mr.Magic" <Muf***@NoWhere.Com> wrote in message news:u9EZPIAAKHA.4432@TK2MSFTNGP05.phx.gbl... >I am going to put up a website with documents where we give our customers a >link to go directly to the document. For safety purposed, I'm going to do >Forms Authentication. The question I have though is if I give somebody a >link to www.itsme.com/WinningLottoNumbers.pdf, it will force them to log >in, just like it should. But once I am done having them log in, how can I >direct the system to WinningLottoNumber.pdf? I don't want them to have to >log in and then do the link again. > > Thanks for your help. > > Jeff. >
Other interesting topics
session state time out
Using if on ASPX-side instead of in code behind restrict number of users Calling Application_Start After Worker Process is Recycled á ÇáÅÓáÇã Úä ÇáÅÑåÇÈ¿ Redirect To Login Page - Forms Authentication Page refresh - Alternative to using frames How can the Login control stop authenticating? American and European Converted from Christianity to ISLAM Trap Data Tier Errors? |
|||||||||||||||||||||||