473,230 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

Form authentication and html files

I have an Asp.Net 2.0 application using form authentication. I want the html
pages be protected by the authentication system too.

The accessing of html files need to be authenticated in my local system.
However, it doesn't after I uploaded the files to my web host site.

Any setting to modify to make my hosting html files need to be authenticated
too?
Jun 22 '06 #1
2 3053
> I have an Asp.Net 2.0 application using form authentication. I want the html
pages be protected by the authentication system too.


You either need to change their extension to .aspx or register .html files
as server-parsed files in IIS manager.
Jun 22 '06 #2

"nick" <ni**@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
I have an Asp.Net 2.0 application using form authentication. I want the
html
pages be protected by the authentication system too.

The accessing of html files need to be authenticated in my local system.
However, it doesn't after I uploaded the files to my web host site.

Any setting to modify to make my hosting html files need to be
authenticated
too?


You (or your host) have iis handle .html files. On the properties tag for
your website go to home directory/configuration/mappings. Add the extension
..html and the executable
yourpathto\microsoft.net\framework\v2.0.50727\aspn et_isapi.dll or to
whatever version you are using. You can just copy the .aspx executable. Then
you have to set up forms authentication in you web.config file as
follows.(Note this is the simplest form or authentication). In you
login.aspx (There are samples in the sdk) form you handle authentication.
You can take if from there to more complicated authentication.
<system.web>
<authentication mode="Forms" >
<forms loginUrl="/login.aspx"
name=".ASPNETAUTH"
protection="All"
requireSSL="false"
slidingExpiration="true"
path="/" timeout="20" >
</forms>
</authentication>
<!-- This section denies access to all files in this application except for
those that you have not explicitly specified by using another setting. -->
<authorization>
<deny users="?" />
</authorization>
</system.web>
<!-- This section gives the unauthenticated user access to
efault.aspx. -->
<location path="default.aspx">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
<!-- This section gives the unauthenticated user access to all of the files
that are stored in the somefolder. -->
<location path="somepublicsection>
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
<!-- This section gives the unauthenticated user access to all of the files
that are stored in the aspnet_client folder for scripts. -->
<location path="aspnet_client">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>
Jun 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
11
by: David W. Simmonds | last post by:
I have a form that will prompt for a user name/password. In VS.NET, I have the protected form in a folder named Admin. I have a Web.config file in that folder as well. It contains the following...
4
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the...
4
by: | last post by:
A Dilemma that I keep being faced with is a scenario where I require authentication on virtually everything. HTMl files, GIF files, XML files, JavaScript files and etc. And I am constantly dealing...
13
by: david | last post by:
I can not figure out what is the problem that I can protect ASP.NEt form resource but not some other type of files, for example, images. All my aspx forms located in Demo folder and image files...
3
by: JIM.H. | last post by:
Hello, I used this site to do form authentication http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod17.asp My code successfully comes to the point: if...
6
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0 data base on NT4 onto IIS on Windows 2003 Server...
1
by: Arun | last post by:
I have a folder “Secured” under the root folder of the project In the project root web.config authentication is given as <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="15"...
8
by: Sergey V | last post by:
Hi, I need to cover by custom authentication algorithm both ASP.NET and other resources within the site. FormsAuthentication covers only resources beeing handled by ASP.NET. Other generic...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.