473,799 Members | 3,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

username and password ....

Hiya
I have to develop a web application for my company in
which I need to have a facility for username and password
for the employees to do certain tasks. How can this be
implemented in ASP. I am thinking of having usernames and
passwards (encrypted) in database and when a person tries
to log in, the script will compare those stored in databse
to the values entered by user. But after the user has
logged in, how can I make sure that the user is always
logged in as user move from one page to another. Also how
I make sure that the user is logged out properly.
Basically my main concern is that no unauthorized user can
access any part of that web app.
Any ideas will be highly appreciated.
Thanks,
Matt.

Jul 19 '05 #1
3 2765
"Matt" <ma**@discussio ns.microsoft.co m> wrote in message
news:04******** *************** *****@phx.gbl.. .
Hiya
I have to develop a web application for my company in
which I need to have a facility for username and password
for the employees to do certain tasks. How can this be
implemented in ASP. I am thinking of having usernames and
passwards (encrypted) in database and when a person tries
to log in, the script will compare those stored in databse
to the values entered by user. But after the user has
logged in, how can I make sure that the user is always
logged in as user move from one page to another. Also how
I make sure that the user is logged out properly.
Basically my main concern is that no unauthorized user can
access any part of that web app.
Any ideas will be highly appreciated.


http://www.aspfaq.com/show.asp?id=2114

Regards,
Peter Foti
Jul 19 '05 #2
Hi Matt,

There are a number of things you can do here. For the login, is it
necessary to give your applications its own user account system? Nothing
frightens users more than yet another username and password to remember. If
you have a domain, I suggest using Windows authentication and managing your
users by their usernames, or better yet, by their SIDs.

As far as keeping unauthorized people out, if you use Windows
authentication, you don't have to worry about people logging in and out and
having sessions. Instead, you have to develop a system by which you can
manage users permissions or access. If your app is as simple as users have
all access or no access, then it's a matter of having a DB with a list of
user accounts that are authorized to the application. Or you can go a
totally different route and have domain group membership determine which
users are authorized to your application. Using group memberships will make
things much simpler to manage, imo.

JoeUser: "Can I have access to this application?"
You: "Yes, one moment."
net group MyApplicationGr oup JoeUser /add /domain
You: "Okay, go ahead. You have access now."
And then within your application, create an include file that is in all your
protected pages with a test like so:

<%

If Not IsAuthorized Then Response.Redire ct "/notauthorized.a sp"
Function IsAuthorized()
Const GROUP_NAME = "YOURDOMAIN/MyApplicationGr oup"
Dim sAuthUser
Dim oGroup, oUser

IsAuthorized = False

sAuthUser = Request.ServerV ariables("AUTH_ USER")
If Len(sAuthUser) > 0 Then
sAuthUser = Replace(sAuthUs er, "/", "\")
Set oGroup = GetObject("WinN T://" & GROUP_NAME & ",group")
Set oUser = GetObject("WinN T://" & sAuthUser & ",user")
IsAuthorized = oGroup.IsMember (oUser.ADsPath)
Set oGroup = Nothing
Set oUser = Nothing
End If
End Function

%>
If you put that in an include and include it in all your pages, it will
protect them (assuming I didn't screw up the code). In order for the
AUTH_USER variable to be populated, you have to turn off anonymous access
for your application within IIS. http://www.iisfaq.com/?View=A26 If I
babbled, it's because I thought as I typed.

Ray at work

"Matt" <ma**@discussio ns.microsoft.co m> wrote in message
news:04******** *************** *****@phx.gbl.. .
Hiya
I have to develop a web application for my company in
which I need to have a facility for username and password
for the employees to do certain tasks. How can this be
implemented in ASP. I am thinking of having usernames and
passwards (encrypted) in database and when a person tries
to log in, the script will compare those stored in databse
to the values entered by user. But after the user has
logged in, how can I make sure that the user is always
logged in as user move from one page to another. Also how
I make sure that the user is logged out properly.
Basically my main concern is that no unauthorized user can
access any part of that web app.
Any ideas will be highly appreciated.
Thanks,
Matt.

Jul 19 '05 #3
mat thereis virtually no way of keeping people out of your application if they
really want in it. looks like a training issue to me

Jul 19 '05 #4

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

Similar topics

7
2799
by: Candice | last post by:
Please somebody help! I've deleted my admin username and password which was initially set at test. Now I can't log into my website as the administrator. How do I put Username and Password back so that I can set my own password and username again, log in to my website and edit it. Which file do I have to edit, and where do I re-set the Username and Password? --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system...
1
4019
by: thoducng | last post by:
I am writing some code to access share folder on a remote network. DirectoryInfo dicInfo = new DirectoryInfo("remoteNetwork\shareFolder"); if (dicInfo.Exists) { //application code followed
11
13973
by: Kevin O'Brien | last post by:
Hello, I am creating a sign on screen for my application in which I want to store the username and password in a database table. I was thinking of putting a combo box connected to the database to pull up the usernames and then having a textbox for the user to enter their password. Can someone tell me please how to compare the contents of the textbox to the password in the database?
5
3780
by: libra786 | last post by:
I have created a blog and have added a login box which prompts the user for login and id before posting- The username and password have been stored in the database, however when i enter the username and pasword it does not seem to compare the values entered with anything. It jus keeps giving the prompt box to enter details. But if i click cancel, then it tels me the incorrect credentials ave been entered i have tried many ways to solve this...
0
8333
by: roamnet | last post by:
hi i created database file with .mdf extention ,sql server as a source and use grid view to display data there're no problem in data retrieve and display,but i want to edit it or insert new records there is an error "Incorrect syntax near '-'. Must declare the scalar variable "@UserName". I worked out in design view,code is automatically generated.Iam not able fix the error. Iam working with Visual Web Developer-2005 Express Edition
0
9688
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
9544
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10238
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7570
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
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.