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

User authentication

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 he is logged in, he is capable
of viewing his details and some special pages

Jun 18 '07 #1
6 1331
sravan_reddy001 <sr*************@gmail.comwrote in
news:11**********************@d30g2000prg.googlegr oups.com:
is there any possibility to authenticate the user without using the
new login contorls.

You can write your own membership provider or you can just use the classic
ASP.NET 1.1 style of login (with forms auth).
Jun 18 '07 #2
I don't know the classic way ASP.NET 1.1 style for login.

But i think i can do it by collecting the username and password and
searching for them in the database. One more thing that stuck me is
When the user is about to use the unauthorised page he should be
redirected to the Login Page and this sholud be stored in the cache;

Jun 18 '07 #3
I read the contents in the Document u gave. got everything about the
project. but

suppose i have a users table in myproject.mdb;

where should i provide these settings in project, should i edit the
webconfig file?. The solution explorer(in the project u gave) is a
great confusion for me. did't got what those properties and settings
meant for

Jun 18 '07 #4
Sorry. Haven't a clue what you mean.

What settings? If you main the usernames and passwords, you have to provide
facilities to get them - either from the user in some sort of registration
process, or by some allocation process carried out by an administrator. If
you use AD instead of a database, you'll get the details from AD.

As for the solution explorer... it just contains the UI (presentation layer)
project, a Typed DataSet for easy access to the data (look it up on msdn,
there's loads there), and a data manager that represents the data access
layer. For simplicity, I didn't code up a business logic layer. In a real
project I'd have only called the Data Access Layer through a business tier.
So it's all just ADO.NET stuff.

If you aren't familiar with ADO.NET you won't have much success with your
project (if it uses a database for authentication. If you use Active
Directory, you'll need to be familiar with Directory Services programming..

I think you need to walk before you can run. If you don't understand the
project I sent and the accompanying document then you're really not ready to
implement forms authentication. You need to get the basics first. This
project is simplified. Real applications would be more complex still.

Sorry
Peter
"sravan_reddy001" <sr*************@gmail.comwrote in message
news:11**********************@q19g2000prn.googlegr oups.com...
>I read the contents in the Document u gave. got everything about the
project. but

suppose i have a users table in myproject.mdb;

where should i provide these settings in project, should i edit the
webconfig file?. The solution explorer(in the project u gave) is a
great confusion for me. did't got what those properties and settings
meant for

Jun 18 '07 #5
thank u...

i' familiar with ADO.NET but new to the ASP.NET

i hav created some simple applications in C# and VB using ADO.NET.

i think i han handle that database access. what i need is how to
redirect the user to login page if he is not authenticated.
(and if possible he should be able to view the Home page even though
he is not authenticated)

user authentication is the only topic where i got stuck in ASP.NET
Jun 18 '07 #6
Ysgrifennodd sravan_reddy001:
thank u...

i' familiar with ADO.NET but new to the ASP.NET

i hav created some simple applications in C# and VB using ADO.NET.

i think i han handle that database access. what i need is how to
redirect the user to login page if he is not authenticated.
(and if possible he should be able to view the Home page even though
he is not authenticated)

user authentication is the only topic where i got stuck in ASP.NET

Hmm. ADO.NET didn't exist until ASP.NET arrived. If you're thinking of
the old 'classic' ADO, then you need to throw all those ideas away and
start again. ADO.NET is not at all like ADO as used before the days of
..NET.

As to how the authentication works, it is all explained in the Word
document and the code, but to give you a start try looking at this from
Global.asax:

<code>

protected void Application_AuthenticateRequest(object sender,
EventArgs e)
{
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie authCookie = Context.Request.Cookies[cookieName];

if (null == authCookie)
{
// There is no authentication cookie
return;
}

FormsAuthenticationTicket authTicket = null;
try
{
authTicket = FormsAuthentication.Decrypt(authCookie.Value);
}
catch
{
// Log exception details (omitted for simplicity)
return;
}

if (null == authTicket)
{
// Cookie failed to decrypt.
return;
}

// When the ticket was created, the user's role was assigned
// to the UserData part of the cookie.
String[] groups = { authTicket.UserData };

// Create an Identity object
GenericIdentity id = new GenericIdentity(authTicket.Name);

// This principal will flow throughout the request.
GenericPrincipal principal = new GenericPrincipal(id, groups);
// Attach the new principal object to the current HttpContext
object
Context.User = principal;
}

</code>

Sections 2.2, 3 and 5 in the Word document explain how this works in
conjunction with the attributes in the code to raise security challenges
that are satisfied (or not) from the information in the GenericPrincipal
that is stored in the current context.

I really don't think I can be much clearer than that :)

If you don't know how the Attributes work, you need to look them up on
msdn (look for PrincipalPermissionAttribute, for example).

Peter
Jun 18 '07 #7

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

Similar topics

4
by: Tim Daneliuk | last post by:
OK, I've Googled for this and cannot seem to quite find what I need. So, I turn to the Gentle Geniuses here for help. Here is what I need to do from within a script: Given a username and a...
4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
5
by: Matthew Louden | last post by:
I wrote ASP.NET application that access SQL Server database. When I run the application, it yields "Login failed for user '<COMPUTER_NAME>\ASPNET'" error message. I then did the following, but...
8
by: Joe | last post by:
I check for the NTLogin of a user by Page.User.Identity.Name, but when I put the app on the server the value for Page.User.Identity.Name is "" I had the <allow users="*/> attribute commented...
15
by: Tom Nowak | last post by:
I am writing a webapp in which a user is required to enter a login id and password on a login form. I have forms authenticaion coded in my web.config. Once the user is logged in, I want to use the...
1
by: noor | last post by:
hi, can any one tell me a javascript that can be called on mouseover event of a html link control . script can check from session either a user is login or not In the case of Login it will...
2
by: J | last post by:
Hello. I apologize if this isn't the appropriate group for this question but I was wondering if it's possible to allow regular windows domain users to change their passwords through an .asp page? ...
3
by: mario.colorado | last post by:
Hi! Does anyone know why it is that when I use: Request.LogonUserIdentity.User.ToString() I get something like: S-1-5-21-2268419..........
9
by: webrod | last post by:
Hi all, how can I check a user/password in a LDAP ? I don't want to connect with this user, I would like to connect to LDAP with a ADMIN_LOG/ADMIN_PWD, then do a query to find the user and...
6
by: MuZZy | last post by:
Hi, I am looking to find a way to get currently logged in user's object GUID without querying ActiveDirectory. For example, when i log in to my laptop from home, I'm not on the office network so...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.