473,654 Members | 2,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Authentication Logout

Hello All:

I am using Windows Authentication in my VB/ASP.NET Intranet Web Application.

How do I create a method that will release the authentication Token, so the
user will no longer have access to any of the resources on the site?

Thanks

Stuart


Nov 18 '05 #1
1 4853
I don't think you can disable the "Token" on the fly. To dynamically
control access, store those who are allowed in a table and those who are not
allowed in another table - or separate views of the same table - or an
array or arraylist and use something like this:
foreach(string user in BannedUsers)
{
if (user == User.Identity.N ame)
{
throw new Exception ("You are not authorized");
}
}

You could do a PrincipalPermis sion.Demand() on the user against a list of
users, but I don't think it buys you much in this case. The concept there
is you create a PermissionPrinc ipal:

bool allowed = false;
foreach(string user in AllowedUsers)
{
try
{
PrincipalPermis sion pp = new PrincipalPermis sion(null, user);
pp.Demand();
allowed = true;
}
catch(Exception ex)
{
}
}

if (!allowed)
throw new Exception ("You're not allowed here!");

Hope this helps

Dale

If the

"Stuart Shay" <ss***@j51.co m> wrote in message
news:#J******** *****@TK2MSFTNG P10.phx.gbl...
Hello All:

I am using Windows Authentication in my VB/ASP.NET Intranet Web Application.
How do I create a method that will release the authentication Token, so the user will no longer have access to any of the resources on the site?

Thanks

Stuart


Nov 18 '05 #2

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

Similar topics

0
2141
by: timbratureman | last post by:
I made an intranet website by php, webserver IIS on windows 2000. To manage users I used the windows authentication. Now I have to create logout.php that has to destroy sessions and windows authentication too, to allow the login to another user from the same pc (for example). I can destroy sessions variables by: session_start(); $_SESSION = array(); session_destroy();
1
2124
by: sherkozmo | last post by:
I have my SQL 7.0 server set for Mixed security. I see now (finally) the advantages of having windows authentication security for windows groups. I do most of my developing in Access Projects which require a login of some type. I have been using my SQL login to develop with SQL and then when I give it to the user, I set the project to use Windows authentication. I want to be able to have Windows authentication on my domain account but...
6
7540
by: Kevin Yu | last post by:
is it possible to for user to click a logout button to logout and when the user want to get into the system again, the user have to login again? Kevin
3
2154
by: JMUApache | last post by:
Hi: I have got a problem with FromsAuthentication for many days. I use "Forms" Authentication in my ASP.NET Web Froms, and I find that I can't singout.... Some Code Here: //In my Logon.aspx, I got the username and password
6
8351
by: Vyoma | last post by:
This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I have been lurking around at several forums with regard to login and user authentication scripts and I have got as far as this: - Starting a session - Registering a session variable - Using the variable to check if the user is authenticated or not. - Authenticating the user through MySQL database - Logging of the user, by setting the...
3
3546
by: bob.abrahamian | last post by:
Hi All. I found several threads about this specific issue here, but could not find a solution to my specific problem. Most of the threads suggested that there would be a difference between launching two separate IE processes and starting two windows in the same IE process (e.g. Control-N). However, I am having this problem with the two separate IE processes. Here is my situation: We have an asp.net 2.0 app that uses formsauthentication....
1
1630
by: abracad_1999 | last post by:
I have installed the open source PHP Deadlock authentication system. It uses .htpasswd and .htaccess files. This works well apart from it doesn't allow user logout without closing their browser. The logout script is shown below. Any suggestions to make it work? Or any other php authentication system that allows user registration, email confirmation, forgotten password reminders, and logout. <?
1
696
by: Rahul | last post by:
Hello All, I'm sure many people must have encountered this problem, but I want to implement the functionality when a user clicks a button and "logs out" so that the next time he attempts to access website, he will be greeted with the authentication dialog box. Is there any way to fulfill my wish? (Sharepoint seems to be popping such screens whenever it wants).
1
5723
by: gnewsgroup | last post by:
I am using forms authentication for a web application. Like many other member web application, my web application prints out Welcome! John Doe (Logout) on the top right corner of each protected page. But, pages can still be visited by following the links in the web application after a session has timed out, data can still be retrieved
5
6784
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page; and someone cannot navigate back to an cached image of the page in theory after the user has signed off. Response.Cache.SetCacheability(HttpCacheability.NoCache); This works all right, except when the user decides to use the browser's back...
0
8290
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8482
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
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 we have to send another system

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.