0
votes

I do have a intranet web application which should be deployed at the client ,i am not aware of the users and roles at the client.Right now i am able to communicate with Active Directory in my development environment in vs2008 in my local system.I am able to authenticate against particular users in my development environment.

I am little confused here in understanding how the actual deployment scenario works with the Active directory.I do have experience with sqlserver DB where super user can add users then assign roles to them.(Thats how my application works)

But in real time scenario how does the active directory authentication works after the deployment as i don't visit the client location to deploy the intranet application.I am completely unaware of the users or their roles or groups in the active directory ?

Is there a general scenario i can work on so that i can implement the active directory scenario ?

1

1 Answers

2
votes

Seeing as this is an intranet application you should probably use Windows Authentication. In the IIS hosting the application Windows Authentication should be set to enabled and the IIS will use active directory to authenticate users.

Call this code

IPrincipal credentials = (IPrincipal)HttpContext.Current.User;
bool isAuthenticated = false;
if (credentials != null)
{
    WindowsIdentity identity = (WindowsIdentity)credentials.Identity;
    isAuthenticated = identity.IsAuthenticated;
}
if (isAuthenticated != null)
{ //do what needs to be done }

when you need to authenticate a user and he will be presented with a windows log in form in which he can enter his active directory controlled account credentials.

Good luck