473,399 Members | 2,858 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,399 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 1335
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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
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...
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,...

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.