Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Any way to have a .Net application not let a .html document go through unless they have logged in? (http://www.velocityreviews.com/forums/t498469-any-way-to-have-a-net-application-not-let-a-html-document-go-through-unless-they-have-logged-in.html)

Mufasa 04-13-2007 03:03 PM

Any way to have a .Net application not let a .html document go through unless they have logged in?
 
I have a web site with a page on it (index.html) that is used for our
internal users but is on a public web site. Currently the entire directory
is password protected through IIS. Problem is - everybody uses the same User
ID/Password.

So I was going to do the normal Forms Authentication that would force
somebody to log in. Got all that to work. If they enter an invalid
password - all works fine. They log in correctly and it takes them to
index.html.

Problem is, if they go directly to index.html it let's them in. Anyway to
stop this from happening. I have <deny users="?" /> in my web.config.

This is in .Net 2.0 btw.

TIA - Jeff.



Cowboy \(Gregory A. Beamer\) 04-13-2007 03:28 PM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
You can set up an HttpHandler for the HTML pages that forces the user
through the same authentication process. I would do a search for HTTP
Handler to find examples. This is, in essence, like an ISAPI filter.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Mufasa" <jb@nowhere.com> wrote in message
news:O8vxtzdfHHA.4156@TK2MSFTNGP02.phx.gbl...
>I have a web site with a page on it (index.html) that is used for our
>internal users but is on a public web site. Currently the entire directory
>is password protected through IIS. Problem is - everybody uses the same
>User ID/Password.
>
> So I was going to do the normal Forms Authentication that would force
> somebody to log in. Got all that to work. If they enter an invalid
> password - all works fine. They log in correctly and it takes them to
> index.html.
>
> Problem is, if they go directly to index.html it let's them in. Anyway to
> stop this from happening. I have <deny users="?" /> in my web.config.
>
> This is in .Net 2.0 btw.
>
> TIA - Jeff.
>
>



Larry Bud 04-13-2007 03:29 PM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
On Apr 13, 11:03 am, "Mufasa" <j...@nowhere.com> wrote:
> I have a web site with a page on it (index.html) that is used for our
> internal users but is on a public web site. Currently the entire directory
> is password protected through IIS. Problem is - everybody uses the same User
> ID/Password.
>
> So I was going to do the normal Forms Authentication that would force
> somebody to log in. Got all that to work. If they enter an invalid
> password - all works fine. They log in correctly and it takes them to
> index.html.
>
> Problem is, if they go directly to index.html it let's them in. Anyway to
> stop this from happening. I have <deny users="?" /> in my web.config.


Why don't you just make index.html a .NET page?




Mufasa 04-13-2007 05:03 PM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
I don't have control over the html page. It's being done by a secretary
through DreamWeaver.

"Larry Bud" <larrybud2002@yahoo.com> wrote in message
news:1176478170.716882.234740@n59g2000hsh.googlegr oups.com...
> On Apr 13, 11:03 am, "Mufasa" <j...@nowhere.com> wrote:
>> I have a web site with a page on it (index.html) that is used for our
>> internal users but is on a public web site. Currently the entire
>> directory
>> is password protected through IIS. Problem is - everybody uses the same
>> User
>> ID/Password.
>>
>> So I was going to do the normal Forms Authentication that would force
>> somebody to log in. Got all that to work. If they enter an invalid
>> password - all works fine. They log in correctly and it takes them to
>> index.html.
>>
>> Problem is, if they go directly to index.html it let's them in. Anyway to
>> stop this from happening. I have <deny users="?" /> in my web.config.

>
> Why don't you just make index.html a .NET page?
>
>
>




Mufasa 04-13-2007 05:03 PM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
Thanks. I'll look for that.

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:A3277343-4A78-4D9B-8A43-336D2B8030C7@microsoft.com...
> You can set up an HttpHandler for the HTML pages that forces the user
> through the same authentication process. I would do a search for HTTP
> Handler to find examples. This is, in essence, like an ISAPI filter.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
>
> *********************************************
> Think outside the box!
> *********************************************
> "Mufasa" <jb@nowhere.com> wrote in message
> news:O8vxtzdfHHA.4156@TK2MSFTNGP02.phx.gbl...
>>I have a web site with a page on it (index.html) that is used for our
>>internal users but is on a public web site. Currently the entire directory
>>is password protected through IIS. Problem is - everybody uses the same
>>User ID/Password.
>>
>> So I was going to do the normal Forms Authentication that would force
>> somebody to log in. Got all that to work. If they enter an invalid
>> password - all works fine. They log in correctly and it takes them to
>> index.html.
>>
>> Problem is, if they go directly to index.html it let's them in. Anyway to
>> stop this from happening. I have <deny users="?" /> in my web.config.
>>
>> This is in .Net 2.0 btw.
>>
>> TIA - Jeff.
>>
>>

>




Rad [Visual C# MVP] 04-14-2007 07:16 AM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
On Fri, 13 Apr 2007 13:03:32 -0400, Mufasa wrote:

> I don't have control over the html page. It's being done by a secretary
> through DreamWeaver.
>
> "Larry Bud" <larrybud2002@yahoo.com> wrote in message


Still, she can just rename it to aspx. It would not be any different to her
but it would make a difference on the server
--
Bits.Bytes
http://bytes.thinkersroom.com

Kris Lankford 04-14-2007 07:53 AM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
Jeff,

Make sure you add the protection="All" and path="/". This should solve your
problem.

<authentication mode="Forms">
<forms name=".Name" loginUrl="~/Login.aspx" timeout="20"
defaultUrl="~/index.html" protection="All" path="/"/>
</authentication>

"Mufasa" <jb@nowhere.com> wrote in message
news:O8vxtzdfHHA.4156@TK2MSFTNGP02.phx.gbl...
>I have a web site with a page on it (index.html) that is used for our
>internal users but is on a public web site. Currently the entire directory
>is password protected through IIS. Problem is - everybody uses the same
>User ID/Password.
>
> So I was going to do the normal Forms Authentication that would force
> somebody to log in. Got all that to work. If they enter an invalid
> password - all works fine. They log in correctly and it takes them to
> index.html.
>
> Problem is, if they go directly to index.html it let's them in. Anyway to
> stop this from happening. I have <deny users="?" /> in my web.config.
>
> This is in .Net 2.0 btw.
>
> TIA - Jeff.
>
>


Mufasa 06-11-2007 02:40 PM

Re: Any way to have a .Net application not let a .html document go through unless they have logged in?
 
This seems to work great. But now I get errors on certain controls -
RequiredFieldValidator and TreeView don't work.

Any thoughts?

"Kris Lankford" <knlankford@hotmail.com> wrote in message
news:D841D6A4-39C2-4186-98EB-106F7AAF6EDE@microsoft.com...
> Jeff,
>
> Make sure you add the protection="All" and path="/". This should solve
> your problem.
>
> <authentication mode="Forms">
> <forms name=".Name" loginUrl="~/Login.aspx" timeout="20"
> defaultUrl="~/index.html" protection="All" path="/"/>
> </authentication>
>
> "Mufasa" <jb@nowhere.com> wrote in message
> news:O8vxtzdfHHA.4156@TK2MSFTNGP02.phx.gbl...
>>I have a web site with a page on it (index.html) that is used for our
>>internal users but is on a public web site. Currently the entire directory
>>is password protected through IIS. Problem is - everybody uses the same
>>User ID/Password.
>>
>> So I was going to do the normal Forms Authentication that would force
>> somebody to log in. Got all that to work. If they enter an invalid
>> password - all works fine. They log in correctly and it takes them to
>> index.html.
>>
>> Problem is, if they go directly to index.html it let's them in. Anyway to
>> stop this from happening. I have <deny users="?" /> in my web.config.
>>
>> This is in .Net 2.0 btw.
>>
>> TIA - Jeff.
>>
>>





All times are GMT. The time now is 07:57 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57