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

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 1328
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
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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?
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
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
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.