473,785 Members | 2,290 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Securing Web Applications thru Form Authentication

A P
Hi!

I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of
security. Can you help me with this?

Me
Nov 19 '05 #1
5 1045
Hi,

Here is some code for the login page. I placed 2 textboxes for
username and passsword and 2 required field validators on the form. The
code is just an example. In a real situation you should store the passwords
encypted. Hope this helps.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub btnClear_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClear.Click

txtUser.Text = ""

txtPassword.Tex t = ""

End Sub

Private Sub btnLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLogin.Click

If Page.IsValid Then

If txtUser.Text = "Mike" And txtPassword.Tex t = "password" Then

Response.Redire ct("Default.asp x")

Else

Response.Write( "Invalid User !")

End If

End If

End Sub

Changes that should be made to Web.config

<authenticati on mode="Forms" >

<forms name="Mypubscoo kie" loginUrl ="Login.aspx " protection="All "
timeout="30">

</forms>

</authentication>

Ken

----------------
"A P" <ap@textguru.ph > wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hi!

I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of
security. Can you help me with this?

Me

Nov 19 '05 #2
A P
Hi Ken,

I have test it but it has an error. The debugger is pointing on the
web.config "<forms name=..." . Is there a mistake on the code that you gave?

Me
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:#0******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

Here is some code for the login page. I placed 2 textboxes for
username and passsword and 2 required field validators on the form. The
code is just an example. In a real situation you should store the passwords encypted. Hope this helps.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub btnClear_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClear.Click

txtUser.Text = ""

txtPassword.Tex t = ""

End Sub

Private Sub btnLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLogin.Click

If Page.IsValid Then

If txtUser.Text = "Mike" And txtPassword.Tex t = "password" Then

Response.Redire ct("Default.asp x")

Else

Response.Write( "Invalid User !")

End If

End If

End Sub

Changes that should be made to Web.config

<authenticati on mode="Forms" >

<forms name="Mypubscoo kie" loginUrl ="Login.aspx " protection="All "
timeout="30">

</forms>

</authentication>

Ken

----------------
"A P" <ap@textguru.ph > wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hi!

I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of security. Can you help me with this?

Me

Nov 19 '05 #3
A P
Hi Ken,

I have test it but it has an error. The debugger is pointing on the
web.config "<forms name=..." . Is there a mistake on the code that you gave?

Me
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:#0******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

Here is some code for the login page. I placed 2 textboxes for
username and passsword and 2 required field validators on the form. The
code is just an example. In a real situation you should store the passwords encypted. Hope this helps.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub btnClear_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClear.Click

txtUser.Text = ""

txtPassword.Tex t = ""

End Sub

Private Sub btnLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLogin.Click

If Page.IsValid Then

If txtUser.Text = "Mike" And txtPassword.Tex t = "password" Then

Response.Redire ct("Default.asp x")

Else

Response.Write( "Invalid User !")

End If

End If

End Sub

Changes that should be made to Web.config

<authenticati on mode="Forms" >

<forms name="Mypubscoo kie" loginUrl ="Login.aspx " protection="All "
timeout="30">

</forms>

</authentication>

Ken

----------------
"A P" <ap@textguru.ph > wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hi!

I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of security. Can you help me with this?

Me

Nov 19 '05 #4
A P
Hi Ken,

I have tried again by removing other remarks on the <authorizatio n> and it
work! Thanks for that. Btw, I have another question, I want this
authorization(l ogin page) be shown if other user will access other webforms
under this web apps that is not yet authenticated. How can I do this?

Me
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:#0******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

Here is some code for the login page. I placed 2 textboxes for
username and passsword and 2 required field validators on the form. The
code is just an example. In a real situation you should store the passwords encypted. Hope this helps.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub btnClear_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClear.Click

txtUser.Text = ""

txtPassword.Tex t = ""

End Sub

Private Sub btnLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLogin.Click

If Page.IsValid Then

If txtUser.Text = "Mike" And txtPassword.Tex t = "password" Then

Response.Redire ct("Default.asp x")

Else

Response.Write( "Invalid User !")

End If

End If

End Sub

Changes that should be made to Web.config

<authenticati on mode="Forms" >

<forms name="Mypubscoo kie" loginUrl ="Login.aspx " protection="All "
timeout="30">

</forms>

</authentication>

Ken

----------------
"A P" <ap@textguru.ph > wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hi!

I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of security. Can you help me with this?

Me

Nov 19 '05 #5
A P
Hi Ken,

I have tried again by removing other remarks on the <authorizatio n> and it
work! Thanks for that. Btw, I have another question, I want this
authorization(l ogin page) be shown if other user will access other webforms
under this web apps that is not yet authenticated. How can I do this?

Me
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:#0******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

Here is some code for the login page. I placed 2 textboxes for
username and passsword and 2 required field validators on the form. The
code is just an example. In a real situation you should store the passwords encypted. Hope this helps.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub btnClear_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnClear.Click

txtUser.Text = ""

txtPassword.Tex t = ""

End Sub

Private Sub btnLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLogin.Click

If Page.IsValid Then

If txtUser.Text = "Mike" And txtPassword.Tex t = "password" Then

Response.Redire ct("Default.asp x")

Else

Response.Write( "Invalid User !")

End If

End If

End Sub

Changes that should be made to Web.config

<authenticati on mode="Forms" >

<forms name="Mypubscoo kie" loginUrl ="Login.aspx " protection="All "
timeout="30">

</forms>

</authentication>

Ken

----------------
"A P" <ap@textguru.ph > wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hi!

I have existing web apps that was developed under ASP. I use form
authentication by querying to a database if the user is allowed to use the
application. I have read that ASP.NET is much easier to manage this kind of security. Can you help me with this?

Me

Nov 19 '05 #6

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

Similar topics

11
3438
by: Wm. Scott Miller | last post by:
Hello all! We are building applications here and have hashing algorithms to secure secrets (e.g passwords) by producing one way hashes. Now, I've read alot and I've followed most of the advice that made sense. One comment I've seen alot about is "securing the hashing routine" but no-one explains how to accomplish this. So how do I secure my hashing routine? Do I use code access security, role based security, ACLs, etc or combination?...
4
2052
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in this case "AuthenticationCookie" -- yeah, original, I know) and the same machine keys for the applications. <authentication mode="Forms"> <forms name="AuthenticationCookie" path="/" loginUrl="login.aspx" protection="All" timeout="10" />
9
1237
by: Johan Pingree | last post by:
HOW in the world is this accomplished! I have an internet site I am prototyping and I need to be able to prevent "casual" browsing of XML documents. Using the web.config forms based authentication does nothing to prevent XML documents from being browsed. We obviously are not interested in turning on digest or basic authentication for this project. Every attempt to use ACL's has resulted in aspx pages having issues in reading and writing to...
0
1638
by: Nabani Silva | last post by:
Hi, hope someone could help I need to share session state (and contents) through differente web applications. I'm trying to get it done by using StateServer session state, below I paste code for web.config. Both applications are on the same server (I don't want to include all applications into one common virtual directory or application)
3
941
by: A P | last post by:
Hi! I have existing web apps that was developed under ASP. I use form authentication by querying to a database if the user is allowed to use the application. I have read that ASP.NET is much easier to manage this kind of security. Can you help me with this? Me
1
1054
by: Dave | last post by:
Hi, 1.) We have a central database of shared values that is maintained by an asp.net app. Only a few admins have access to the maintenance forms for this data which is secured by a simple web.config in forms folder for now. 2.) This application also exposes some webservices that allows client applications to consume the data that is maintained within it. How can I restrict which of our intranet applications consume the
0
1871
by: alberich | last post by:
I have a problem securing my webservice with Windows authentication. The goal is a client app transfering (large amounts of) data to a server which is blocked for anonymous requests. To do this, the client app asks the user for credentials, build some NetworkCredential wit them & adds them to the CredentialCache. When i look at the iis log, each call to my webmethod appears twice in the log - first try without credentials (which fails with...
4
3604
by: =?Utf-8?B?RmFyaWJh?= | last post by:
It know that we can use the following method http://msdn2.microsoft.com/en-us/library/eb0zx8fc.aspx to form authenticate across multiple applications. I have created an asp.net application that supports form authentication. My application is going to be called by another legacy application (HTML) which does the initial authentication.Something like this: <form name="form1" action="auth.asp" method="post" >
10
3373
by: Les Desser | last post by:
In article <fcebdacd-2bd8-4d07-93a8-8b69d3452f3e@s50g2000hsb.googlegroups.com>, The Frog <Mr.Frog.to.you@googlemail.comMon, 14 Apr 2008 00:45:10 writes Not sure if I quite follow that. 1. Data encrypted by AES key 2. AES key encrypted with Asymmetric public key (?)
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.