473,497 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I do key based Authentication in C#

I used to write websites in classic ASP which authenticated a user and
retrieved a comma separated list of "keys" via a COALESCE query from a
SQL Server database which determined which areas of the site they
could access.

The list was stored in a session variable and could be something like
"news,stocks,charts,reports".

Then for instance, at the top of the "Stocks.asp" page, there would be
a line of code which did a simple string search on the session
variable to see if the "stocks" "key" or word was present and either
let the user view the page or redirect them somewhere else such as a
login page.

Could anyone please explain how I could implement this in C# ?

I have just mastered Forms-Based Authentication using the Web.Config
file to denote which pages are effectively private and public which is
working fine but this is not specific to each user.

<location path="default1.aspx">
<system.web>
<authorization>
<allow users ="*" />
</authorization>
</system.web>
</location>

I basically need to authenticate users and only allow them access to a
page if they possess the necessary key which has been associated with
their user record in the SQL Server database.

Would this need to be a modification of Forms-Based Authentication or
something completely different ?

I would be extremely grateful for any advice or a URL of an article
which explains how to do this.

Regards
John Smith
Jul 21 '05 #1
3 1329
Hi

Has anyone got any suggestions for this one yet. I think it's the sort
of problem that many programmers will get at sometime.

Jihn
Jul 21 '05 #2
Cor
Hi Fresh Air Rider,

We see you get no answer here, did you already try it in the newsgroup

microsoft.public.dotnet.aspnet

I hope you find your answer,

Cor
Jul 21 '05 #3
Hi Cor

Thanks for that.

I actually got a reply here http://tinyurl.com/2agjd

Thanks
John
Jul 21 '05 #4

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

Similar topics

11
3814
by: Bozo Schmozo | last post by:
Greetings! I've searched groups.google.com already to see if I can determine if using PHP/MySQL (if needed) for a web site I wish to develop. As the subject indicated, it will be a content...
10
3576
by: See Sharp | last post by:
Hello all, I have a set of admin pages which are put in a subfolder called admin inside my application folder. I want to limit access to these admin pages. How can I do this? In Linux, I can...
1
3474
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
1
1450
by: Malik Asif Joyia | last post by:
Hello I want to implement the forms based authentication. for a sub directory in my webapplication. I have allready applied Forms based authentication in my webapplication ,, I have added a folder...
1
1457
by: - Steve - | last post by:
I have a directory that I want to use forms based authentication on. There's a couple of pages in that directory that I want to allow anonymous access to. There's also one page that I want to...
13
1665
by: david | last post by:
I can not figure out what is the problem that I can protect ASP.NEt form resource but not some other type of files, for example, images. All my aspx forms located in Demo folder and image files...
5
1904
by: Archer | last post by:
I was making a role-based authentication but it does't login with correct password. the HttpContext.Current.User recieved in Global.asax is always null. Request.IsAuthenticated is always false....
3
2975
by: | last post by:
One thing I did a lot of in Classic ASP involved showing page elements conditionally based on whether a user was logged in or not. Logged in users or "superusers" would get more content and/or more...
5
2331
by: Nalaka | last post by:
Hi, I have a asp.net application with forms authentication enabled. Users create private (database driven) messages (pages; like a message board) that is only viewed by logged in users. Now I...
4
2279
by: santosh.tripathy | last post by:
We have a requirement where in a java based web application is getting integrated with the existing .net based web pages. The .net based web pages are secured through forms authentication. Is there...
0
7121
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
6993
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
7162
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,...
1
6881
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
5456
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,...
1
4899
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
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 ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.