473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

authentication project

im working on a project that involves creating a back end solution to
authenticate and manage user

accounts for a website. im new to python and am looking for some good
references that can help me

with this task.

the requirements for the project are as follows:

A new user can register with their email address and password of their
choice. Upon registration, a

confirmation email shall be sent which contains a link that needs to be
clicked on within a fixed

period of time in order to activate the account. Access to site
resources shall be limited to users

that have registered a valid user account. Also, the solution must
automatically lock a given user

account should an incorrect password be attempted repeatedly within a
set timeframe. All necessary

data is stored in a SQL Server database and Pyton Database API v2.0 is
used to connect to the

database.

I need to develop a suitable schema and Python module to provide this
functionality.

Any help is much appreciated.

Thanks,

JT

Aug 7 '05 #1
2 1373
On 7 Aug 2005 10:48:50 -0700, "jayt33" <ja****@gmail.com> declaimed the
following in comp.lang.python:
im working on a project that involves creating a back end solution to
authenticate and manage user

accounts for a website. im new to python and am looking for some good
references that can help me
While you do specify "back-end", I'm not clear enough on how
this will be invoked... CGI, mod_python, Zope/Plone (though that set
already has authentication out of the box), CherryPy...

Who is responsible for the Web interface to the user? The login
screen, session cookies (going to be needed to identify a user a
logged-in as they go from page to page).

Or are you just a small module that some other existing
web-application will make use of, where that application handles all
user interface and session management. Who handles session time-out, you
or the application? Who handles the confirmation link handling? {you'll
notice I'm making reference to thing below}
with this task.

the requirements for the project are as follows:

A new user can register with their email address and password of their
choice. Upon registration, a

confirmation email shall be sent which contains a link that needs to be
clicked on within a fixed
I hope your web interface is using encrypted sessions for the
password, though you shouldn't be storing the password in the database
anyway -- store some one-way hash of it.

Your master is probably going to have to invoke something like:

if not accountmanager.create(user, password):
# return message that the account could not be entered
# maybe the user is already in the database

accountmanager.create() will have to:
1 check for the existence of the user in the data and
reject the request if found
2 hash the password, store the user id, password, and time stamp
into the database (along with some record id for the email link
and a flag for UNCONFIRMED)
3 format a confirmation request email and send it out

The master, when the email link is clicked, will have to do
something of:

if not accountmanager.confirm(unique_link_id):
# return message that the account could not be
# confirmed -- perhaps too much time, or bogus
# link ID, or already confirmed

accountmanager.confirm() does
1 retrieve record with specified ID, rejecting if the ID is not
found
2 compare confirmation time with creation time stamp and
reject if too much time has passed. Maybe delete the
user record from the database (so the id can be reused
on a new registration attempt)
3 compare status flag and reject if already confirmed
4 accept confirmation and update status flag to CONFIRMED
and set the account to UNLOCKED
The master, on a normal page request will check for a valid
session cookie; if found, it goes on -- otherwise it puts up the login
page and...

status = accountmanager.login(user, password)
if status == INCORRECT:
# return message about incorrect user/password
# DO NOT be particular, you don't want to tell someone
# that a password is incorrect for a valid user id, or
# that a user id is unknown
elif status == LOCKED:
# return message about locked account
else:
# set time limited session cookie

accountmanager.login() needs to do:
1 retrieve record for user; if no such user reject as INCORRECT
2 compare hashed password to saved hash; if no match,
reject as INCORRECT (ONLY AFTER COMPUTING LOCKED
STATE). Check "time of last login attempt" -- if
this attempt is > whatever the attempt period is, save this
time as the "time of last login attempt" and save Tries = 1. If
this attempt time is < time of last + attempt period, save Tries
Tries + 1. If Tries > limit, save and return status as LOCKED.
3 save time as time of last login attempt, optionally return Tries
so master can produce a "there were x failed login attempts
since your last successful login", return SUCCESS

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Aug 7 '05 #2
Hi,

for some of the "ground work" you could use the Python Web Modules
(www.pythonweb.org).

fs
Aug 10 '05 #3

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

Similar topics

1
by: Phil Powell | last post by:
/*-------------------------------------------------------------------------------------------- This function will utilize the ability to use HTTP-based WWW Authentication, checking for the global...
1
by: Morten | last post by:
Hi! I have implemented forms based authentication in one of my web projects. It finally works. The problem is that I have another project in a directory underneath this project. This project of...
5
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want...
3
by: Molly J. Fagan | last post by:
Hello-- I'm using forms authentication and have 2 web projects located under the same root directory. In the web.config of the second project, I have <authentication mode="Forms"> <forms...
4
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the...
3
by: ~~~ .NET Ed ~~~ | last post by:
This is a strange problem and I wonder if anybody has experienced this annoying anomaly. I created a new ASP.NET project with its web-shared directory on my WinXP Pro/IIS machine. I compile the...
3
by: Paul Mason | last post by:
Hi folks, An odd one for the start of this week. I have a web project that I have taken over from a colleague. He had the authentication set to windows, but I have now changed that to forms...
2
by: karthi84 | last post by:
hi, i have created a web project in visual studio 2003 in a networked system and it worked fine. when i tried to access that project through a browser from another system in the same...
6
by: sravan_reddy001 | last post by:
is there any possibility to authenticate the user without using the new login contorls. i'm ready to create new tables and design. all that i need is track weather the user is online or not. If...
11
by: benoitc | last post by:
I've been having a problem debugging an ASP.NET 1.1 application on an existing Windows XP/Visual Studio 2003 workstation that I've inherited from somebody else. The application builds fine, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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,...
0
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...

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.