Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Going to a link but need to log in.

Reply
Thread Tools

Going to a link but need to log in.

 
 
Mr.Magic
Guest
Posts: n/a
 
      07-08-2009

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.


 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      07-08-2009

"Mr.Magic" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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

*******************************************
| Think outside the box! |
*******************************************
 
Reply With Quote
 
 
 
 
Muj Beg
Guest
Posts: n/a
 
      07-09-2009
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

"Mr.Magic" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.
>


 
Reply With Quote
 
Mr.Magic
Guest
Posts: n/a
 
      07-16-2009
Thanks everybody for the help. I guess my question is once the person has
logged in, how do I know what the name of the file that was requested?

"Muj Beg" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> "Mr.Magic" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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.
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
On my web site need the capability to log in as administrator and for others to log in anonymously AAaron123 ASP .Net 1 10-14-2008 08:14 PM
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
Need help on the Permissions needed to log to Event Log from ASP.NET? Henrik_the_boss ASP .Net 0 11-05-2003 10:14 AM
VPN going up but traffic going one way PLP Cisco 1 07-11-2003 08:28 AM



Advertisments