Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys, I've been developping an ASP.NET Web API that I initially chose with no authentication.

Now I've been asked to implement authentication and authorization using Active Directory.

I had never even heard of Active Directory until then... but now I've been looking at some guides online about what it is and how to use it and it all seems rather complicated from my point of view...

I was given a computer (besides mine but connected to it through a switch) in which a virtual machine is running and there I have a Server Manager in which I can find my Active Directory Domain Services that have examples of users and computers so that I can test the connection and build the code before using the real thing.

The thing is, even after reading all those guides and asking around I still have no idea where to even start to implement the authentication.

Isn't it possible to just have 2 variables ("name", "password"), send it to the Active Directory server to check if they exist and what permissions they have and have return --> if ok the permissions (another variable) else not ok? Or someting along these lines?

I'm asking this because the bulk of my application in being built in Ember and it would be really easier for me to pass these values through the controller REST API style.

Please help me to get started and if what I'm suggestion is stupid please suggest how I should do it.

PS: I'm an intern left to work alone on an entire application with no help (have mercy! ;) ).
Posted
Updated 17-Mar-15 0:18am
v2

1 solution

I'd suggest to read this: http://stackoverflow.com/questions/4453801/check-userid-exists-in-active-directory-using-c-sharp[^]. I'm not sure that meets your criteria, but... it's an idea. Seems, you do not have to get user name and password from user. You have to read only user name from OS variables (actually logged user). Follow the link provided there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900