473,387 Members | 1,575 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,387 software developers and data experts.

Forms Authentication using SQL Server - problem

Hi everyone,

Quick question, I'm creating a Timesheet Application with ASP.NET C# in
Visual Studio 2003. The database has been built using MSDE. I have
followed the MSDN libraries guide to creating forms based
authentication from

http://msdn.microsoft.com/library/de...SecNetht03.asp

This works fine, however all the code does is return a message to a
label on screen saying that the user has been authenticated. What I
need is for the application to forward the user on to the default.aspx
form, and allow them to access all subsequent forms from there. I
suspect I need to insert some code in the passwordVerifed part.

if (passwordVerified == true )
{
// The user is authenticated
// At this point, an authentication ticket is normally created
// This can subsequently be used to generate a GenericPrincipal
// object for .NET authorization purposes
// For details, see "How To: Use Forms authentication with
// GenericPrincipal objects
lblMessage.Text = "Logon successful: User is authenticated";
I think it may be something along the lines of
FormsAuthentication.redirect but as I'm a newbie I'm probably wrong!..

As well as this, once I have redirected the verified user to the
correct page, do I then need some additional code at the top of each
form to check the user is verified?

Any help will be much appreciated!
Thanks in advance..

Al

Feb 5 '06 #1
1 1107
thebison,

Since I wrote this up a long time ago, I'm going to just point you to the
article.
That should do the trick. It's not enough just to determine if the username
and password match. Article explains:

http://www.eggheadcafe.com/articles/20020906.asp

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"thebison" wrote:
Hi everyone,

Quick question, I'm creating a Timesheet Application with ASP.NET C# in
Visual Studio 2003. The database has been built using MSDE. I have
followed the MSDN libraries guide to creating forms based
authentication from

http://msdn.microsoft.com/library/de...SecNetht03.asp

This works fine, however all the code does is return a message to a
label on screen saying that the user has been authenticated. What I
need is for the application to forward the user on to the default.aspx
form, and allow them to access all subsequent forms from there. I
suspect I need to insert some code in the passwordVerifed part.

if (passwordVerified == true )
{
// The user is authenticated
// At this point, an authentication ticket is normally created
// This can subsequently be used to generate a GenericPrincipal
// object for .NET authorization purposes
// For details, see "How To: Use Forms authentication with
// GenericPrincipal objects
lblMessage.Text = "Logon successful: User is authenticated";
I think it may be something along the lines of
FormsAuthentication.redirect but as I'm a newbie I'm probably wrong!..

As well as this, once I have redirected the verified user to the
correct page, do I then need some additional code at the top of each
form to check the user is verified?

Any help will be much appreciated!
Thanks in advance..

Al

Feb 5 '06 #2

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

Similar topics

11
by: ElmoWatson | last post by:
I tried on the Security newgroup, as well as other places, and haven't gotten an answer yet - - I'm pulling my hair out over this one. I'm trying to get Forms Authentication working.....I can get...
1
by: Scott | last post by:
Hi, We're having an issue with Forms Authentication cookies being treated as expired / invalid, and being deleted. This is causing our intranet users a great deal of pain - Running IIS 5.0 on...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
9
by: Hermit Dave | last post by:
Hi, I am making a web application (rather two applications) one which is host and used by customers when they are just browsing through products. The second application resides on a secure...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
5
by: Cesar | last post by:
Hello, I have an application that is using forms authentication and it seems to be working fine most of the time. Unfortunatelly, it sometimes just redirects me to the login screen. It seems that...
1
by: charles | last post by:
Hi all, I have an ASP.Net application that has worked swell on both my development environment and production for some time now. Development is running on a WinXP Pro box, Production is running...
6
by: William F. Zachmann | last post by:
We've got a project going that involves moving an old web site with a massive dll written in C++ that produces most of the output from a SQL 7.0 data base on NT4 onto IIS on Windows 2003 Server...
4
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
4
by: Bjorn Sagbakken | last post by:
In a web-application with login creds (user, pwd), these are checked against a user table on a SQL server. On a positive validation I have saved the userID, name, custno and role-settings in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...

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.