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

How to verify if a user has been authenticated

5
Hi there,

I want to know if a unique token or some identifier is issued upon successful logon

to a Windows machine via Active Directory.

If yes, then is it possible to retrieve this token and pass it on to some

application, and that applicaiton could then call Active Directory to verify if the

token was genuine?

Does AD provide a service to verify the token, or any alternatives?



Thanks.
Feb 4 '10 #1
7 4537
Plater
7,872 Expert 4TB
If the user is logged on, isn't that verification enough?
Feb 4 '10 #2
asimhg
5
If an authenticated user is issued a unique token, then we want to pass that token to our application, the application will then send the token to Active Directory for verification and if this is successful, application will be launched.

So what I need to know is if :

1) AD issues some kind of a unique token to an authenticated user
2) Can this token be retrieved via C#
3) Is there exists a web service or some other mechanism, that we could send this token to for verification?

Thanks,
Feb 4 '10 #3
If I understand correctly, you want make the launch of the GUI of your application dependent on the authentication status of the user?!

How about an NTLM authentication with InitializeSecurityContext
on localhost?
This is how it generally works:
http://davenport.sourceforge.net/ntlm.html
And here's a reference to the method.
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

However, since the tokens are generated as you do the authentication,
you may want to store a challenge token locally, then generate the response token from the stored challenge token.
That way you'll always get the same response token and can use values from
it for that for some kind of encryption.

It's been a long time since I did something similar, but let me try to sum up:

1: don't know about AD, but within the NTLM authentication process you'll get a challenge token - you could store this challenge token locally and reuse it,
if you need the response token to be the same every time
2: yes - you'd need to do the NTLM stuff with C++ as it's Win32, but if you do it with managed C++, you can then use the DLL from C#.
3: yeah, the securitycontext.

I personally never worked with
http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspx
Maybe that does what you want without having to switch language.
Feb 4 '10 #4
Why dont you authenticate user directly against Active Directory while launching ur application using some Login window. I have done similar kind of stuff for one website. I m posting one link...might help u.


http://msdn.microsoft.com/en-us/library/ms180890.aspx
Feb 5 '10 #5
Plater
7,872 Expert 4TB
Wait if this was a website you can just add to your web.config that a section of the website requires a valid windows login.

Something like:
Expand|Select|Wrap|Line Numbers
  1. <location path="Admin">
  2.     <system.web>
  3.         <identity impersonate="false"/>
  4.         <!-- WS: Allow only Authenticated users -->
  5.         <authorization>
  6.             <deny users="?"/>
  7.         </authorization>
  8.     </system.web>
  9. </location>
  10.  
Feb 5 '10 #6
asimhg
5
The issue is that we don't want to supply the password again to re-authenticate the user.

If an authenticated user is issued a unique token, then we want to pass that token to our application, the application will then send the token to Active Directory for verification and if this is successful, application will be launched.

So what I need to know is if :

1) AD issues some kind of a unique token to an authenticated user
2) Can this token be retrieved via C#
3) Is there exists a web service or some other mechanism, that we could send this token to for verification?

Thanks,
Feb 5 '10 #7
Plater
7,872 Expert 4TB
Ok well is this a windows application or a web aplication.

For webapplications, what i listed will NOT throw a popup login box if the user accessing the webpage is:
a) Using IE (FF doesn't do it)
b) A valid user on the domain


For windows applications there is the System.Security.Principal.WindowsIdentity.GetCurre nt() method
Feb 8 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

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...
2
by: Simon Harvey | last post by:
Hi, This is a very typical requirement so I'm sure the answer is very straightforward. If a user tries to get to a secure directory, they can be a sent to a login page automatically. Once the...
2
by: Dan | last post by:
hi ng, i have a problem with windows authentification. i want to forward every user who 1. is not authorized 2. or could not be authenticated to a login page -------------------
5
by: Andrew | last post by:
Hi, friends, I keep wondering if there is a better way to verify a user. Now, in my asp.net app, each time a user signed in, I saved his/her userID in Session object. In each following pages, I...
2
by: Robert Rotstein | last post by:
How does one determine from Global.Application_BeginRequest() -- where no Session information is available -- whether the invoking user has been authenticated?
2
by: gabriel.salama | last post by:
I am desperately trying to create a login page in ASP.NET in which a user can be authenticated against a Domino Directory but for the life of me, I cannot even find anything remotely close to this...
0
by: fadi | last post by:
Hey guys, I've been working on this for few days with no luck. I need to create folders and files on a remote server using UNC Path. This works great as long as the user can authenticate first,...
1
by: Enemaerke | last post by:
Hi I've searched through this newsgroup but have been unable to find something to answer my question so I'd better go ahead and post it We are currently developing a web service for processing...
3
by: shapper | last post by:
Hello, How to I check if a user is authenticated and if it is what is its role? I am using Asp.Net 2.0 and forms authentication. Thanks, Miguel
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
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
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...

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.