Home All Groups Group Topic Archive Search About

Going to a link but need to log in.

Author
8 Jul 2009 7:26 PM
Mr.Magic
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.

Author
8 Jul 2009 8:21 PM
Gregory A. Beamer
"Mr.Magic" <Muf***@NoWhere.Com> wrote in
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.


AFAIK, setting up forms authentication is all you have to do to get this
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


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
Show quoteHide quote
|      Think outside the box!             |
*******************************************
Are all your drivers up to date? click for free checkup

Author
9 Jul 2009 10:57 PM
Muj Beg
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.
>

Bookmark and Share