Ask a Question related to ASP.NET Security, Design and Development.
-
Michael Tissington #1
Forms authentication and downloading files
How can I use Forms Authentication to give clients access to download
specific exe files?
Thanks.
--
Michael Tissington
[url]http://www.oaklodge.com[/url]
Michael Tissington Guest
-
Accessing htm files without authentication (forms authentication)
I have application with forms authentication. All works fine. When user opens .aspx file gets login form, login and then get the .aspx page. But... -
forms authentication doesn't work for static pages/files like GIF/HTML/PDF ?
do I understand it correctly that forms authentication doesn't work for static pages/files like GIF/HTML/PDF ? so I cannot convince IIS to... -
Authentication ticket, cookieless, forms authentication?
Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the... -
Forms authentication for HTML files
You could map HTML files in IIS admin to the aspnet handler, or, a better way, you could utilize a helper ASPX that takes the html file's path... -
Excluding certain files from forms authentication
Hi I have a website which uses forms based authentication. However, I need to exclude a file from authentication so that all users can view it.... -
Lauchlan M #2
Re: Forms authentication and downloading files
> How can I use Forms Authentication to give clients access to download
I answered this in your other thread.> specific exe files?
>
> Thanks.
Lauchlan M
Lauchlan M Guest
-
Michael Tissington #3
Re: Forms authentication and downloading files
Well it does not quite work ... of course I maybe doing something wrong :)
Before I add the mapping ASP.NET security does nothing and I can download
the file.
After I add the mapping then the Forms Authentication works. HOWEVER the
file is NOT downloaded, I simply get a blank page ...
Any ideas please.
--
Michael Tissington
[url]http://www.oaklodge.com[/url]
"Lauchlan M" <LMackinnon@Hotmail.com> wrote in message
news:%23VorrtqjDHA.1456@tk2msftngp13.phx.gbl...>> > How can I use Forms Authentication to give clients access to download
> > specific exe files?
> >
> > Thanks.
> I answered this in your other thread.
>
> Lauchlan M
>
>
Michael Tissington Guest
-
Lauchlan M #4
Re: Forms authentication and downloading files
> Before I add the mapping ASP.NET security does nothing and I can download
Well, that's working then! <g>> the file.
> After I add the mapping then the Forms Authentication works. HOWEVER the
> file is NOT downloaded, I simply get a blank page ...
What do you want it to do? You don't want it to go the requested resource,
because they don't have permission for it. I don't want to spend the time
looking this up for you, but I expect you would have to generate/handle some
sort of error code (like 404 page not found, but something custom) and
provide a page to tell the user they did not have access to that page. Or
you log them out, or redirect them to the home page, or whatever you want to
do.
Maybe you might want to ask on one of the MS IIS newgroups as well, since it
is much an IIS question as an ASP.NET one.
FWIW, I handle this in one of the globa.asax methods (ie before the page is
loaded), and if they are trying to access a resource they don't have
permissions for, I log them out and bounce them back to the login page, with
a message telling them they were getting out of line (not in those words of
course . . .).
HTH
Lauchlan M
Lauchlan M Guest
-
Michael Tissington #5
Re: Forms authentication and downloading files
I think I might not have been clear ....
After I have done the mapping then the exe file is only available after they
have logged in. However I want them to be able to download the EXE and
instead all they get is a blank page ...
--
Michael Tissington
[url]http://www.tabtag.com[/url]
[url]http://www.oaklodge.com[/url]
"Lauchlan M" <LMackinnon@Hotmail.com> wrote in message
news:uRKD4NsjDHA.1284@TK2MSFTNGP09.phx.gbl...download> > Before I add the mapping ASP.NET security does nothing and I cansome>> > the file.
> > After I add the mapping then the Forms Authentication works. HOWEVER the
> > file is NOT downloaded, I simply get a blank page ...
> Well, that's working then! <g>
>
> What do you want it to do? You don't want it to go the requested resource,
> because they don't have permission for it. I don't want to spend the time
> looking this up for you, but I expect you would have to generate/handleto> sort of error code (like 404 page not found, but something custom) and
> provide a page to tell the user they did not have access to that page. Or
> you log them out, or redirect them to the home page, or whatever you wantit> do.
>
> Maybe you might want to ask on one of the MS IIS newgroups as well, sinceis> is much an IIS question as an ASP.NET one.
>
> FWIW, I handle this in one of the globa.asax methods (ie before the pagewith> loaded), and if they are trying to access a resource they don't have
> permissions for, I log them out and bounce them back to the login page,of> a message telling them they were getting out of line (not in those words> course . . .).
>
> HTH
>
> Lauchlan M
>
>
Michael Tissington Guest
-
Lauchlan M #6
Re: Forms authentication and downloading files
they> I think I might not have been clear ....
>
> After I have done the mapping then the exe file is only available afterI don't know. Try on the IIS group, since this mapping stuff is IIS related.> have logged in. However I want them to be able to download the EXE and
> instead all they get is a blank page ...
Or maybe someone else will chip in.
Good luck
Lauchlan M
Lauchlan M Guest
-
MSFT #7
RE: Forms authentication and downloading files
Hi Michael,
I test following steps on windows server 2003 (IIS 6.0) and they seems to
be able to resolve the problem.
In IIS Manager, right click the virtual folder and select
"Properties/Directory". Click "Configration" button, and then add an
application extension:
executable: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspne t_isapi.dll
extension .exe
restart IIS. When I input following link in IE:
[url]Http://localhost/webapplication1/cc.exe[/url]
It will first redirct to the login form and then pop up the download
dialog. ("webApplication1" has been set with Form Authentication)
Hope this help,
Luke
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
MSFT Guest
-
Michael Tissington #8
Re: Forms authentication and downloading files
Luke,
When I do this and I click on my 'exe' link I do get my forms authentication
page but then I get a blank page, the download of the exe does not happen.
--
Michael Tissington
[url]http://www.tabtag.com[/url]
[url]http://www.oaklodge.com[/url]
"MSFT" <lukezhan@online.microsoft.com> wrote in message
news:wqWomTvjDHA.1928@cpmsftngxa06.phx.gbl...> Hi Michael,
>
> I test following steps on windows server 2003 (IIS 6.0) and they seems to
> be able to resolve the problem.
>
> In IIS Manager, right click the virtual folder and select
> "Properties/Directory". Click "Configration" button, and then add an
> application extension:
>
> executable: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspne t_isapi.dll
>
> extension .exe
>
> restart IIS. When I input following link in IE:
>
> [url]Http://localhost/webapplication1/cc.exe[/url]
>
> It will first redirct to the login form and then pop up the download
> dialog. ("webApplication1" has been set with Form Authentication)
>
> Hope this help,
>
> Luke
> Microsoft Online Support
>
> Get Secure! [url]www.microsoft.com/security[/url]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Michael Tissington Guest
-
MSFT #9
Re: Forms authentication and downloading files
Hi Michael,
If it is not form authentication, what will happen? And your framework and
IIS version?
Luke
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
MSFT Guest
-
Michael Tissington #10
Re: Forms authentication and downloading files
If I don't use any authentication then when I click on the link I can
download the exe.
With forms authentication, after being authenticated I get a blank page.
This is running on Windows 2003 (so I assume IIS 6 with the latest
Framework)
--
Michael Tissington
[url]http://www.tabtag.com[/url]
[url]http://www.oaklodge.com[/url]
"MSFT" <lukezhan@online.microsoft.com> wrote in message
news:maYVyP9jDHA.1716@cpmsftngxa06.phx.gbl...> Hi Michael,
>
> If it is not form authentication, what will happen? And your framework and
> IIS version?
>
> Luke
> Microsoft Online Support
>
> Get Secure! [url]www.microsoft.com/security[/url]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Michael Tissington Guest
-
MSFT #11
Re: Forms authentication and downloading files
Hi Michael,
If you create a new virtual folder and test again, will this work? I test
this on two computers: windows 2000 and 2003, both of work fine. Therefore,
I suspect if this is related to the configrations on your IIS or web
application, we may try a little more to ensure this. Additionally, when
opeing the login page, is redirect link correct in IE's adrress bar?
Luke
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
MSFT Guest
-
Michael Tissington #12
Re: Forms authentication and downloading files
Hello,
I have created a new virtual folder (before I was trying a real folder).
Now I can not get past my authentication form - it just keeps in a loop.
In the IE address bar the redirect link is correct.
In addition it seems that its is trying to run my exe on the server that its
trying to download - if I don't give the directory Execute permission then
when I try to view the page I get an error saying that I'm trying to run a
CGI or EXE ....
So why is it trying to run it instead of download it ?
--
Michael Tissington
[url]http://www.tabtag.com[/url]
[url]http://www.oaklodge.com[/url]
"MSFT" <lukezhan@online.microsoft.com> wrote in message
news:lZthU3YkDHA.2784@cpmsftngxa06.phx.gbl...Therefore,> Hi Michael,
>
> If you create a new virtual folder and test again, will this work? I test
> this on two computers: windows 2000 and 2003, both of work fine.> I suspect if this is related to the configrations on your IIS or web
> application, we may try a little more to ensure this. Additionally, when
> opeing the login page, is redirect link correct in IE's adrress bar?
>
> Luke
> Microsoft Online Support
>
> Get Secure! [url]www.microsoft.com/security[/url]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Michael Tissington Guest
-
MSFT #13
Re: Forms authentication and downloading files
Hi Michael,
I'm thinking that the following config file might help:
<!-- web.config -->
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.exe" type="System.Web.StaticFileHandler"/>
</httpHandlers>
</system.web>
</configuration>
The StaticFileHandler returns the contents of the document and it may solve
this problem. You may also check you machine.config and web.config, to see
if there are some httphandler added before.
Luke
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
MSFT Guest
-
Michael Tissington #14
Re: Forms authentication and downloading files
Thanks!
--
Michael Tissington
[url]http://www.tabtag.com[/url]
[url]http://www.oaklodge.com[/url]
"MSFT" <lukezhan@online.microsoft.com> wrote in message
news:B7s04WwkDHA.2088@cpmsftngxa06.phx.gbl...solve> Hi Michael,
>
> I'm thinking that the following config file might help:
>
> <!-- web.config -->
>
> <configuration>
>
> <system.web>
>
> <httpHandlers>
>
> <add verb="*" path="*.exe" type="System.Web.StaticFileHandler"/>
>
> </httpHandlers>
>
> </system.web>
>
> </configuration>
>
>
> The StaticFileHandler returns the contents of the document and it may> this problem. You may also check you machine.config and web.config, to see
> if there are some httphandler added before.
>
> Luke
> Microsoft Online Support
>
> Get Secure! [url]www.microsoft.com/security[/url]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
Michael Tissington Guest
-
Michael Tissington #15
Re: Forms authentication and downloading files
Luk,
OK, I can get it working if I do NOT use a virtual directory in IIS.
If I create a virtual directory then I can never get past the Forms
Authentication page.
It authenticates and then displays they logon page again and again ...
Any idea what would be causing this?
--
Michael Tissington
[url]http://www.tabtag.com[/url]
[url]http://www.oaklodge.com[/url]
"MSFT" <lukezhan@online.microsoft.com> wrote in message
news:B7s04WwkDHA.2088@cpmsftngxa06.phx.gbl...solve> Hi Michael,
>
> I'm thinking that the following config file might help:
>
> <!-- web.config -->
>
> <configuration>
>
> <system.web>
>
> <httpHandlers>
>
> <add verb="*" path="*.exe" type="System.Web.StaticFileHandler"/>
>
> </httpHandlers>
>
> </system.web>
>
> </configuration>
>
>
> The StaticFileHandler returns the contents of the document and it may> this problem. You may also check you machine.config and web.config, to see
> if there are some httphandler added before.
>
> Luke
> Microsoft Online Support
>
> Get Secure! [url]www.microsoft.com/security[/url]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
Michael Tissington Guest
-
MSFT #16
Re: Forms authentication and downloading files
Hi Michael,
If we didn't create a virtual folder, it also wouldn't cause the form
authentication. You can try to add the handler suggested in my previous
post, to see if it will hep. Addtionally, you may try to download a .dat
file (also add application extension for .data in IIS) to see if it will
generate same problem.
Luke
Microsoft Online Support
Get Secure! [url]www.microsoft.com/security[/url]
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
MSFT Guest



Reply With Quote

