PC Review


Reply
Thread Tools Rate Thread

Did I implement the login correctly?

 
 
Randy Morgan
Guest
Posts: n/a
 
      6th Aug 2005
I used, or tried to use, suggestions from this NG to implement a login
for a protected area of my site. I'd appreciate it if any of you
adventurous types want to try and "break in" before I put anything
really important there.

The login page is at:

http://www.leonardforiowa.com/login.asp

If you can get to any URL in the 'secure_area' directory, I've messed it up.

And, as long as I'm typing, I've got a few questions:

Is there a command I can use on the login page code to keep entries from
being cached? In particular, I don't want anything to still be in the
password field when the page is loaded or refreshed.

When a user types in a password, the actual characters show up. How can
I have them masked with **** or dots or whatever you see on most other
websites.

And, last, as I've been messing with database results and things FP
frequently tells me to rename files to use the .asp extension, which is
no problem, but got me thinking: Is there any reason not to use the
..asp extension for all my pages (assuming they're not php pages or
something, of course) instead of .htm? Will it hurt anything?

Thanks,

--
Randy Morgan
 
Reply With Quote
 
 
 
 
Randy Morgan
Guest
Posts: n/a
 
      6th Aug 2005
One more question:

I'd like to have more than one username and password combination that
will work on the login page. I've tried to modify verify.asp to check
more than one combination, but when I upload it the function breaks,
resulting in the browser simply displaying the contents of verify.asp
instead of returning a value.

I'm not sure if the entire structure is wrong or if I should be using
braces instead of parentheses or it's something else entirely. The uid
and pwd are passed from the login.asp form.

Here's the code I'm using:

<%
If
(
(Request.Form("uid") = "uid1" AND Request.Form("pwd") = "pwd1")
OR
(Request.Form("uid") = "uid2" AND Request.Form("pwd") = "pwd2")
)
Then
Session("Authenticated") = 1
Response.Redirect "http://www.leonardforiowa.com/secure_area/home.asp"
Else
Session("Authenticated") = 0
Response.Redirect "http://www.leonardforiowa.com/loginfail.asp"
End If
%>
Randy Morgan

Randy Morgan wrote:
> I used, or tried to use, suggestions from this NG to implement a login
> for a protected area of my site. I'd appreciate it if any of you
> adventurous types want to try and "break in" before I put anything
> really important there.
>
> The login page is at:
>
> http://www.leonardforiowa.com/login.asp
>
> If you can get to any URL in the 'secure_area' directory, I've messed it
> up.
>
> And, as long as I'm typing, I've got a few questions:
>
> Is there a command I can use on the login page code to keep entries from
> being cached? In particular, I don't want anything to still be in the
> password field when the page is loaded or refreshed.
>
> When a user types in a password, the actual characters show up. How can
> I have them masked with **** or dots or whatever you see on most other
> websites.
>
> And, last, as I've been messing with database results and things FP
> frequently tells me to rename files to use the .asp extension, which is
> no problem, but got me thinking: Is there any reason not to use the
> .asp extension for all my pages (assuming they're not php pages or
> something, of course) instead of .htm? Will it hurt anything?
>
> Thanks,
>

 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      6th Aug 2005
If you are seeing ASP code in the verify.asp page it is because you are using it from a non .asp page or your verify.asp has html in
it (its should only have VB script in it)

Watch out that your entire If Then is on 1 line if you are using multiple line for the code
- your mulitline script does not show any script line breaks _ as in

If _
( _
(Request.Form("uid") = "uid1" AND Request.Form("pwd") = "pwd1") _
OR _
(Request.Form("uid") = "uid2" AND Request.Form("pwd") = "pwd2") _
) _
Then
...
Else
...
End If


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"Randy Morgan" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
| One more question:
|
| I'd like to have more than one username and password combination that
| will work on the login page. I've tried to modify verify.asp to check
| more than one combination, but when I upload it the function breaks,
| resulting in the browser simply displaying the contents of verify.asp
| instead of returning a value.
|
| I'm not sure if the entire structure is wrong or if I should be using
| braces instead of parentheses or it's something else entirely. The uid
| and pwd are passed from the login.asp form.
|
| Here's the code I'm using:
|
| <%
| If
| (
| (Request.Form("uid") = "uid1" AND Request.Form("pwd") = "pwd1")
| OR
| (Request.Form("uid") = "uid2" AND Request.Form("pwd") = "pwd2")
| )
| Then
| Session("Authenticated") = 1
| Response.Redirect "http://www.leonardforiowa.com/secure_area/home.asp"
| Else
| Session("Authenticated") = 0
| Response.Redirect "http://www.leonardforiowa.com/loginfail.asp"
| End If
| %>
| Randy Morgan
|
| Randy Morgan wrote:
| > I used, or tried to use, suggestions from this NG to implement a login
| > for a protected area of my site. I'd appreciate it if any of you
| > adventurous types want to try and "break in" before I put anything
| > really important there.
| >
| > The login page is at:
| >
| > http://www.leonardforiowa.com/login.asp
| >
| > If you can get to any URL in the 'secure_area' directory, I've messed it
| > up.
| >
| > And, as long as I'm typing, I've got a few questions:
| >
| > Is there a command I can use on the login page code to keep entries from
| > being cached? In particular, I don't want anything to still be in the
| > password field when the page is loaded or refreshed.
| >
| > When a user types in a password, the actual characters show up. How can
| > I have them masked with **** or dots or whatever you see on most other
| > websites.
| >
| > And, last, as I've been messing with database results and things FP
| > frequently tells me to rename files to use the .asp extension, which is
| > no problem, but got me thinking: Is there any reason not to use the
| > .asp extension for all my pages (assuming they're not php pages or
| > something, of course) instead of .htm? Will it hurt anything?
| >
| > Thanks,
| >


 
Reply With Quote
 
Randy Morgan
Guest
Posts: n/a
 
      6th Aug 2005
Thanks so much for the feedback. I don't know anything about VB syntax,
so I was completely unaware of the need for the _ character.

thanks,
Randy Morgan

Stefan B Rusynko wrote:
> If you are seeing ASP code in the verify.asp page it is because you are using it from a non .asp page or your verify.asp has html in
> it (its should only have VB script in it)
>
> Watch out that your entire If Then is on 1 line if you are using multiple line for the code
> - your mulitline script does not show any script line breaks _ as in
>
> If _
> ( _
> (Request.Form("uid") = "uid1" AND Request.Form("pwd") = "pwd1") _
> OR _
> (Request.Form("uid") = "uid2" AND Request.Form("pwd") = "pwd2") _
> ) _
> Then
> ...
> Else
> ...
> End If
>
>

 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      6th Aug 2005
See inline comments below

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"Randy Morgan" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
|I used, or tried to use, suggestions from this NG to implement a login
| for a protected area of my site. I'd appreciate it if any of you
| adventurous types want to try and "break in" before I put anything
| really important there.

With any "login" server side scripting you need to be aware of preventing possible SQL injection attacks / hacks and that means you
must script defensively - for more info see
http://www.spidynamics.com/papers/SQ...WhitePaper.pdf

- your simple login script does not prevent possible attacks
- how defensive you script depends on how sensitive the pages or data (say from a DB) you are "protecting"

|
| The login page is at:
|
| http://www.leonardforiowa.com/login.asp
|
| If you can get to any URL in the 'secure_area' directory, I've messed it up.

There are tools available that will test your site for vulnerablities

|
| And, as long as I'm typing, I've got a few questions:
|
| Is there a command I can use on the login page code to keep entries from
| being cached? In particular, I don't want anything to still be in the
| password field when the page is loaded or refreshed.

If you don't set a default form field value the form field will be empty when called on an ASP page or contain prior inputs when
called from the browser back button
If you set both fields as password fields they will be blank even using the browser back button

|
| When a user types in a password, the actual characters show up. How can
| I have them masked with **** or dots or whatever you see on most other
| websites.

In the form field properties set the option for it to be a password field


| And, last, as I've been messing with database results and things FP
| frequently tells me to rename files to use the .asp extension, which is
| no problem, but got me thinking: Is there any reason not to use the
| .asp extension for all my pages (assuming they're not php pages or
| something, of course) instead of .htm? Will it hurt anything?

If you are using ASP to protect your pages you must use .ASP pages
(so the "protected" page is processed server side before client side)
- the FP DBRW requires .asp pages
When you start an ASP session it remains active if you are w/i .asp pages and the ASP session timeout has not expired
Since you are using session variables you should be using .asp for all the pages after a session starts (your login page) to keep
the current session running
See http://www.devguru.com/Technologies/...f/session.html


| Thanks,
|
| --
| Randy Morgan


 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      6th Aug 2005
PS
or you are testing it from a disc based web (instead of a server based web that supports ASP)

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"Stefan B Rusynko" <(E-Mail Removed)> wrote in message news:%23ViNu$(E-Mail Removed)...
| If you are seeing ASP code in the verify.asp page it is because you are using it from a non .asp page or your verify.asp has html
in
| it (its should only have VB script in it)
|
| Watch out that your entire If Then is on 1 line if you are using multiple line for the code
| - your mulitline script does not show any script line breaks _ as in
|
| If _
| ( _
| (Request.Form("uid") = "uid1" AND Request.Form("pwd") = "pwd1") _
| OR _
| (Request.Form("uid") = "uid2" AND Request.Form("pwd") = "pwd2") _
| ) _
| Then
| ...
| Else
| ...
| End If
|
|
| --
|
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| "Warning - Using the F1 Key will not break anything!" (-;
| To find the best Newsgroup for FrontPage support see:
| http://www.net-sites.com/sitebuilder/newsgroups.asp
| _____________________________________________
|
|
| "Randy Morgan" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
|| One more question:
||
|| I'd like to have more than one username and password combination that
|| will work on the login page. I've tried to modify verify.asp to check
|| more than one combination, but when I upload it the function breaks,
|| resulting in the browser simply displaying the contents of verify.asp
|| instead of returning a value.
||
|| I'm not sure if the entire structure is wrong or if I should be using
|| braces instead of parentheses or it's something else entirely. The uid
|| and pwd are passed from the login.asp form.
||
|| Here's the code I'm using:
||
|| <%
|| If
|| (
|| (Request.Form("uid") = "uid1" AND Request.Form("pwd") = "pwd1")
|| OR
|| (Request.Form("uid") = "uid2" AND Request.Form("pwd") = "pwd2")
|| )
|| Then
|| Session("Authenticated") = 1
|| Response.Redirect "http://www.leonardforiowa.com/secure_area/home.asp"
|| Else
|| Session("Authenticated") = 0
|| Response.Redirect "http://www.leonardforiowa.com/loginfail.asp"
|| End If
|| %>
|| Randy Morgan
||
|| Randy Morgan wrote:
|| > I used, or tried to use, suggestions from this NG to implement a login
|| > for a protected area of my site. I'd appreciate it if any of you
|| > adventurous types want to try and "break in" before I put anything
|| > really important there.
|| >
|| > The login page is at:
|| >
|| > http://www.leonardforiowa.com/login.asp
|| >
|| > If you can get to any URL in the 'secure_area' directory, I've messed it
|| > up.
|| >
|| > And, as long as I'm typing, I've got a few questions:
|| >
|| > Is there a command I can use on the login page code to keep entries from
|| > being cached? In particular, I don't want anything to still be in the
|| > password field when the page is loaded or refreshed.
|| >
|| > When a user types in a password, the actual characters show up. How can
|| > I have them masked with **** or dots or whatever you see on most other
|| > websites.
|| >
|| > And, last, as I've been messing with database results and things FP
|| > frequently tells me to rename files to use the .asp extension, which is
|| > no problem, but got me thinking: Is there any reason not to use the
|| > .asp extension for all my pages (assuming they're not php pages or
|| > something, of course) instead of .htm? Will it hurt anything?
|| >
|| > Thanks,
|| >
|
|


 
Reply With Quote
 
Randy Morgan
Guest
Posts: n/a
 
      6th Aug 2005
No, I published it to my host, which supports ASP, and that's where it
broke. It's probably the line breaks I inserted when I modified the code.

Randy Morgan

Stefan B Rusynko wrote:
> PS
> or you are testing it from a disc based web (instead of a server based web that supports ASP)
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Can't Authenticate correctly to Domain Controller to login to TS. jm_admin Microsoft Windows 2000 Terminal Server Clients 0 20th May 2008 03:19 PM
How to implement a automatic login function Victor Microsoft ASP .NET 10 8th Jun 2007 04:05 PM
How to implement login form with Application framework enabled? Karel Kral Microsoft VB .NET 1 26th May 2006 11:06 AM
Implement Remember password feature in Login Dialog Sandeep Singh Microsoft Dot NET Framework Forms 2 9th Jan 2006 08:20 AM
How to implement multiple login forms? James X. Li Microsoft ASP .NET 2 3rd Jan 2004 06:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 AM.