Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > password protecting a page

Reply
Thread Tools

password protecting a page

 
 
Phil Hellmuth
Guest
Posts: n/a
 
      05-03-2007
Pardon my ignorance...I'm new to .NET...but I want a user to be forced
to submit login credentials before displaying a page. Is there a quick,
easy way to do this? Don't worry about verifying the ID/PW...that's
taken care of.

Thanks in advance.
 
Reply With Quote
 
 
 
 
David Longnecker
Guest
Posts: n/a
 
      05-03-2007
If you're on an IIS box, you can turn Windows Authentication on and have
them authenticate to the domain of the server (assuming an internal application).


If you're authenticating using forms via Membership, you can add a Login
control to your page (.NET 2.0+). This control, along with a bit of connecting
via your web.config and your SQL Server, will provide authentication and
authorization functionality.

If you simply just want them to type in SOMETHING, then two text boxes and
a button with a function in the code to verify the input.

Or something else? You mention that the authentication (verifying) is taken
care of, but with no insight how... if you have a secondary user control/web
service for this, then a couple text boxes may be what you're looking for
(opting for simplicity).

HTH.

-dl

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com

> Pardon my ignorance...I'm new to .NET...but I want a user to be forced
> to submit login credentials before displaying a page. Is there a
> quick, easy way to do this? Don't worry about verifying the
> ID/PW...that's taken care of.
>
> Thanks in advance.
>



 
Reply With Quote
 
 
 
 
Phil Hellmuth
Guest
Posts: n/a
 
      05-03-2007
Thanks for your response. The purpose is to prevent unauthorized users
from seeing a particular page. My client simply wants to use hard-coded
ID/PW values. The only way to get to the page is by entering the url.
Ideally, a dialog box prompting for credentials is the way to do this,
as opposed to an additional page. Does your second paragraph accomplish
this?


David Longnecker wrote:
> If you're on an IIS box, you can turn Windows Authentication on and have
> them authenticate to the domain of the server (assuming an internal
> application).
>
> If you're authenticating using forms via Membership, you can add a Login
> control to your page (.NET 2.0+). This control, along with a bit of
> connecting via your web.config and your SQL Server, will provide
> authentication and authorization functionality.
>
> If you simply just want them to type in SOMETHING, then two text boxes
> and a button with a function in the code to verify the input.
>
> Or something else? You mention that the authentication (verifying) is
> taken care of, but with no insight how... if you have a secondary user
> control/web service for this, then a couple text boxes may be what
> you're looking for (opting for simplicity).
>
> HTH.
>
> -dl
>
> ---
> David R. Longnecker
> Web Developer
> http://blog.tiredstudent.com
>
>> Pardon my ignorance...I'm new to .NET...but I want a user to be forced
>> to submit login credentials before displaying a page. Is there a
>> quick, easy way to do this? Don't worry about verifying the
>> ID/PW...that's taken care of.
>>
>> Thanks in advance.
>>

>
>

 
Reply With Quote
 
Lloyd Sheen
Guest
Posts: n/a
 
      05-03-2007

"Phil Hellmuth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for your response. The purpose is to prevent unauthorized users
> from seeing a particular page. My client simply wants to use hard-coded
> ID/PW values. The only way to get to the page is by entering the url.
> Ideally, a dialog box prompting for credentials is the way to do this, as
> opposed to an additional page. Does your second paragraph accomplish
> this?
>
>
> David Longnecker wrote:
>> If you're on an IIS box, you can turn Windows Authentication on and have
>> them authenticate to the domain of the server (assuming an internal
>> application).
>>
>> If you're authenticating using forms via Membership, you can add a Login
>> control to your page (.NET 2.0+). This control, along with a bit of
>> connecting via your web.config and your SQL Server, will provide
>> authentication and authorization functionality.
>>
>> If you simply just want them to type in SOMETHING, then two text boxes
>> and a button with a function in the code to verify the input.
>>
>> Or something else? You mention that the authentication (verifying) is
>> taken care of, but with no insight how... if you have a secondary user
>> control/web service for this, then a couple text boxes may be what you're
>> looking for (opting for simplicity).
>>
>> HTH.
>>
>> -dl
>>
>> ---
>> David R. Longnecker
>> Web Developer
>> http://blog.tiredstudent.com
>>
>>> Pardon my ignorance...I'm new to .NET...but I want a user to be forced
>>> to submit login credentials before displaying a page. Is there a
>>> quick, easy way to do this? Don't worry about verifying the
>>> ID/PW...that's taken care of.
>>>
>>> Thanks in advance.
>>>

>>


If you are just looking for a simple roll your own method you could check
for a session item on the page load and if it does not exist then redirect
to the logon page (which when filled in correctly would redirect them to the
page which is password protected. It would also create the session item so
that subsequent visits to the page in the session would not need to be
revalidated.

Hope this helps.

Lloyd Sheen

 
Reply With Quote
 
David Longnecker
Guest
Posts: n/a
 
      05-04-2007
You can use the Authentication tools built into ASP.NET to match to stored
static values, located in your web.config or a database table. Here's a
brief walkthrough provided by Peter Bromberg:

http://www.eggheadcafe.com/tutorials...thenticat.aspx



---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com

> "Phil Hellmuth" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> Thanks for your response. The purpose is to prevent unauthorized
>> users from seeing a particular page. My client simply wants to use
>> hard-coded ID/PW values. The only way to get to the page is by
>> entering the url. Ideally, a dialog box prompting for credentials is
>> the way to do this, as opposed to an additional page. Does your
>> second paragraph accomplish this?
>>
>> David Longnecker wrote:
>>
>>> If you're on an IIS box, you can turn Windows Authentication on and
>>> have them authenticate to the domain of the server (assuming an
>>> internal application).
>>>
>>> If you're authenticating using forms via Membership, you can add a
>>> Login control to your page (.NET 2.0+). This control, along with a
>>> bit of connecting via your web.config and your SQL Server, will
>>> provide authentication and authorization functionality.
>>>
>>> If you simply just want them to type in SOMETHING, then two text
>>> boxes and a button with a function in the code to verify the input.
>>>
>>> Or something else? You mention that the authentication (verifying)
>>> is taken care of, but with no insight how... if you have a secondary
>>> user control/web service for this, then a couple text boxes may be
>>> what you're looking for (opting for simplicity).
>>>
>>> HTH.
>>>
>>> -dl
>>>
>>> ---
>>> David R. Longnecker
>>> Web Developer
>>> http://blog.tiredstudent.com
>>>> Pardon my ignorance...I'm new to .NET...but I want a user to be
>>>> forced to submit login credentials before displaying a page. Is
>>>> there a quick, easy way to do this? Don't worry about verifying
>>>> the ID/PW...that's taken care of.
>>>>
>>>> Thanks in advance.
>>>>

> If you are just looking for a simple roll your own method you could
> check for a session item on the page load and if it does not exist
> then redirect to the logon page (which when filled in correctly would
> redirect them to the page which is password protected. It would also
> create the session item so that subsequent visits to the page in the
> session would not need to be revalidated.
>
> Hope this helps.
>
> Lloyd Sheen
>



 
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
Password protecting some features of the page joe Javascript 0 05-14-2008 12:06 PM
password protecting on page on a site RainLover HTML 1 08-04-2004 02:37 PM
Password Protecting a Page Michael HTML 2 04-18-2004 08:44 PM
Password protecting folders and content in Win2k MErC Computer Support 3 01-09-2004 05:32 PM
Password protecting areas Jon Agiato ASP .Net 2 08-23-2003 08:37 PM



Advertisments