473,657 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Authenticate against Active Directory

Jon
I am modifying an app for a customer in ASP.Net 1.1. The app is running on a
server outside their network, yet they want to authenticate users against
their internal active directory set up (they will open the necessary ports).

So, I have a simple login page with username and password, and then I will
authenticate that credentials entered against their AD server. I am having a
real hard time figuring this out. We can't use Windows Forms Auth, so I need
to do it all manually in code.

On the System.Director yServices namespace I can't find what methods I need
to connect to their AD using SSL and then to authenticate the user. I've
found a lot online using Forms Auth and ADAM, but nothing has really fit
what I'm doing.

Could anyone point me to a tutorial or outline what methods, etc I need to
use to accomplish this?

Thank you so much!
Jon

Jun 27 '08 #1
4 2276
Hi Jon,

I did AD authentication in one of my page in ASP.NET 2.0 , you can
find same in 1.1

/// <summary>
/// This will get user list.
/// </summary>
protected bool GetSearchUserDa ta()
{
try
{
//Bind Search UserList grid as per user entered

string loginName = txtSULoginName. Text;
string firstName = txtSUFirstName. Text;
string lastName = txtSULastName.T ext;

string ActiveDirectory Server =
Convert.ToStrin g(Configuration Manager.AppSett ings["ActiveDirector yServer"]);

// User that can access domain user details
string ADUserName =
Convert.ToStrin g(Configuration Manager.AppSett ings["ADUserName "]);
string ADUserPassword =
Convert.ToStrin g(Configuration Manager.AppSett ings["ADUserPassword "]);

DirectoryEntry entry = new
DirectoryEntry( ActiveDirectory Server, ADUserName, ADUserPassword) ;
DirectorySearch er ds = new DirectorySearch er(entry);

ds.Filter = "(&(objectClass =user)(objectCl ass=person))";
if (loginName != "")
{
ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
ds.Filter += "(sAMAccountNam e=" + loginName.Trim( ) +
"*))";
}
if (firstName != "")
{
ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
ds.Filter += "(givenName =" + firstName.Trim( ) + "*))";
}
if (lastName != "")
{
ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
ds.Filter += "(sn=" + lastName.Trim() + "*))";
}

dtSearchUserLis t.Columns.Clear ();
dtSearchUserLis t.Columns.Add(n ew DataColumn("Log inName",
typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew DataColumn("Fir stName",
typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew DataColumn("Las tName",
typeof(string)) );

foreach (SearchResult sr in ds.FindAll())
{
DataRow row = dtSearchUserLis t.NewRow();
string name = sr.Properties["Name"][0].ToString();
string firstname = "";
string lastname = "";

if (name.Length == 0)
{
firstname = "";
lastname = "";
}
else if (name.IndexOf(" ,") != -1)
{
iActualLength = name.Length;
iLength = name.IndexOf(", ") + 2;

if (iActualLength < iLength)
{
firstname = "";
lastname = name;
}
else
{
firstname = name.Substring( name.IndexOf(", ") +
2);
lastname = name.Substring( 0,
name.IndexOf(", "));
}
}
else if (name.IndexOf(" ") != -1)
{
iActualLength = name.Length;
iLength = name.IndexOf(" ") + 1;

if (iActualLength < iLength)
{
firstname = "";
lastname = name;
}
else
{
lastname = name.Substring( name.IndexOf(" ") +
1);
firstname = name.Substring( 0, name.IndexOf("
"));
}
}
else
{
firstname = "";
lastname = name;
}
row["FirstName"] = firstname.Repla ce("'", "");
row["LastName"] = lastname.Replac e("'", "");
row["LoginName"] = sr.Properties["SamAccountName "]
[0].ToString();
dtSearchUserLis t.Rows.Add(row) ;
}

if (dtSearchUserLi st != null &&
dtSearchUserLis t.Rows.Count 0)
{
dtSearchUserLis t.DefaultView.S ort = "LoginName ASC,
FirstName ASC, LastName ASC";
dgADUserList.Da taSource = dtSearchUserLis t;
dgADUserList.Da taBind();
blSUSearchSuces s = true;
lblSUErrorText. Text = "";
}
else
{
dtSearchUserLis t.Columns.Clear ();
dtSearchUserLis t.Columns.Add(n ew DataColumn("Sel ect",
typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew
DataColumn("Log inName", typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew
DataColumn("Fir stName", typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew
DataColumn("Las tName", typeof(string)) );
dgADUserList.Da taSource = dtSearchUserLis t;
dgADUserList.Da taBind();
lblSUErrorText. Text = ErrorLog.GetTex t("NoUsers");
blSUSearchSuces s = false;
}
}
catch (Exception ex)
{
blSUSearchSuces s = false;
TraceSUError.Lo g("\nAn error occurred while fetching user
details.\nExcep tion occurred : " + ex.Message);
strURL = "ErrorPage.aspx ?strErrPageName =SearchUsers.as px";
Response.Redire ct(strURL, false);
}

return blSUSearchSuces s;
}

Also you can check login user details,

IIdentity WinId = HttpContext.Cur rent.User.Ident ity;
WindowsIdentity wi = (WindowsIdentit y)WinId;

strDCHLoginID = wi.Name.Split(' \\')[1];
hidDHLoginID.Va lue = wi.Name.Split(' \\')
[1];

if (ValidLoginUser Data(strDCHLogi nID)) //check user is
present in Database

Regards,
Abhijit B

On May 7, 12:59*pm, "Jon" <rosenb...@main streams.comwrot e:
I am modifying an app for a customer in ASP.Net 1.1. The app is running ona
server outside their network, yet they want to authenticate users against
their internal active directory set up (they will open the necessary ports).

So, I have a simple login page with username and password, and then I will
authenticate that credentials entered against their AD server. I am havinga
real hard time figuring this out. We can't use Windows Forms Auth, so I need
to do it all manually in code.

On the System.Director yServices namespace I can't find what methods I need
to connect to their AD using SSL and then to authenticate the user. I've
found a lot online using Forms Auth and ADAM, but nothing has really fit
what I'm doing.

Could anyone point me to a tutorial or outline what methods, etc I need to
use to accomplish this?

Thank you so much!
Jon
Jun 27 '08 #2
Jon
Thank you! I will try this and see if I can get it working. Two questions -
the AppSettings AD user and pass - do those need to be for the domain admin?
Second, the ActiveDirectory Server variable - would that just be the windows
machine name of the AD server or a full domain name, etc?

Thanks, again
Jon

"ABHIJIT B" <ab************ ***@gmail.comwr ote in message
news:4f******** *************** ***********@e53 g2000hsa.google groups.com...
Hi Jon,

I did AD authentication in one of my page in ASP.NET 2.0 , you can
find same in 1.1

/// <summary>
/// This will get user list.
/// </summary>
protected bool GetSearchUserDa ta()
{
try
{
//Bind Search UserList grid as per user entered

string loginName = txtSULoginName. Text;
string firstName = txtSUFirstName. Text;
string lastName = txtSULastName.T ext;

string ActiveDirectory Server =
Convert.ToStrin g(Configuration Manager.AppSett ings["ActiveDirector yServer"]);

// User that can access domain user details
string ADUserName =
Convert.ToStrin g(Configuration Manager.AppSett ings["ADUserName "]);
string ADUserPassword =
Convert.ToStrin g(Configuration Manager.AppSett ings["ADUserPassword "]);

DirectoryEntry entry = new
DirectoryEntry( ActiveDirectory Server, ADUserName, ADUserPassword) ;
DirectorySearch er ds = new DirectorySearch er(entry);

ds.Filter = "(&(objectClass =user)(objectCl ass=person))";
if (loginName != "")
{
ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
ds.Filter += "(sAMAccountNam e=" + loginName.Trim( ) +
"*))";
}
if (firstName != "")
{
ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
ds.Filter += "(givenName =" + firstName.Trim( ) + "*))";
}
if (lastName != "")
{
ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
ds.Filter += "(sn=" + lastName.Trim() + "*))";
}

dtSearchUserLis t.Columns.Clear ();
dtSearchUserLis t.Columns.Add(n ew DataColumn("Log inName",
typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew DataColumn("Fir stName",
typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew DataColumn("Las tName",
typeof(string)) );

foreach (SearchResult sr in ds.FindAll())
{
DataRow row = dtSearchUserLis t.NewRow();
string name = sr.Properties["Name"][0].ToString();
string firstname = "";
string lastname = "";

if (name.Length == 0)
{
firstname = "";
lastname = "";
}
else if (name.IndexOf(" ,") != -1)
{
iActualLength = name.Length;
iLength = name.IndexOf(", ") + 2;

if (iActualLength < iLength)
{
firstname = "";
lastname = name;
}
else
{
firstname = name.Substring( name.IndexOf(", ") +
2);
lastname = name.Substring( 0,
name.IndexOf(", "));
}
}
else if (name.IndexOf(" ") != -1)
{
iActualLength = name.Length;
iLength = name.IndexOf(" ") + 1;

if (iActualLength < iLength)
{
firstname = "";
lastname = name;
}
else
{
lastname = name.Substring( name.IndexOf(" ") +
1);
firstname = name.Substring( 0, name.IndexOf("
"));
}
}
else
{
firstname = "";
lastname = name;
}
row["FirstName"] = firstname.Repla ce("'", "");
row["LastName"] = lastname.Replac e("'", "");
row["LoginName"] = sr.Properties["SamAccountName "]
[0].ToString();
dtSearchUserLis t.Rows.Add(row) ;
}

if (dtSearchUserLi st != null &&
dtSearchUserLis t.Rows.Count 0)
{
dtSearchUserLis t.DefaultView.S ort = "LoginName ASC,
FirstName ASC, LastName ASC";
dgADUserList.Da taSource = dtSearchUserLis t;
dgADUserList.Da taBind();
blSUSearchSuces s = true;
lblSUErrorText. Text = "";
}
else
{
dtSearchUserLis t.Columns.Clear ();
dtSearchUserLis t.Columns.Add(n ew DataColumn("Sel ect",
typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew
DataColumn("Log inName", typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew
DataColumn("Fir stName", typeof(string)) );
dtSearchUserLis t.Columns.Add(n ew
DataColumn("Las tName", typeof(string)) );
dgADUserList.Da taSource = dtSearchUserLis t;
dgADUserList.Da taBind();
lblSUErrorText. Text = ErrorLog.GetTex t("NoUsers");
blSUSearchSuces s = false;
}
}
catch (Exception ex)
{
blSUSearchSuces s = false;
TraceSUError.Lo g("\nAn error occurred while fetching user
details.\nExcep tion occurred : " + ex.Message);
strURL = "ErrorPage.aspx ?strErrPageName =SearchUsers.as px";
Response.Redire ct(strURL, false);
}

return blSUSearchSuces s;
}

Also you can check login user details,

IIdentity WinId = HttpContext.Cur rent.User.Ident ity;
WindowsIdentity wi = (WindowsIdentit y)WinId;

strDCHLoginID = wi.Name.Split(' \\')[1];
hidDHLoginID.Va lue = wi.Name.Split(' \\')
[1];

if (ValidLoginUser Data(strDCHLogi nID)) //check user is
present in Database

Regards,
Abhijit B

On May 7, 12:59 pm, "Jon" <rosenb...@main streams.comwrot e:
I am modifying an app for a customer in ASP.Net 1.1. The app is running on
a
server outside their network, yet they want to authenticate users against
their internal active directory set up (they will open the necessary
ports).

So, I have a simple login page with username and password, and then I will
authenticate that credentials entered against their AD server. I am having
a
real hard time figuring this out. We can't use Windows Forms Auth, so I
need
to do it all manually in code.

On the System.Director yServices namespace I can't find what methods I need
to connect to their AD using SSL and then to authenticate the user. I've
found a lot online using Forms Auth and ADAM, but nothing has really fit
what I'm doing.

Could anyone point me to a tutorial or outline what methods, etc I need to
use to accomplish this?

Thank you so much!
Jon
Jun 27 '08 #3
Hi Jon,

Two questions -
the AppSettings AD user and pass - do those need to be for the domain
admin?

It can be any user who can access all user details present in your
domain(e.g. firstname, lastname, email, loginid etc.).
If your site is hosted in QA/Production environment I suggest to have
Admin user credentials.

Second, the ActiveDirectory Server variable - would that just be the
windows
machine name of the AD server or a full domain name, etc?

ActiveDirectory Server is domainname

In Web.Config you can mention for example :-

<add key="ActiveDire ctoryServer" value="LDAP://xyznet.org" />
domainname
<add key="ADUserName " value="xyz\jon" /domainname\user name or
simply username
<add key="ADUserPass word" value="password " />

Regards,
Abhijit B

On May 8, 7:49*am, "Jon" <rosenb...@main streams.comwrot e:
Thank you! I will try this and see if I can get it working. Two questions -
the AppSettings AD user and pass - do those need to be for the domain admin?
Second, the ActiveDirectory Server variable - would that just be the windows
machine name of the AD server or a full domain name, etc?

Thanks, again
Jon

"ABHIJIT B" <abhijitbavdhan ...@gmail.comwr ote in message

news:4f******** *************** ***********@e53 g2000hsa.google groups.com...
Hi Jon,

I did AD authentication in one of my page in ASP.NET 2.0 , you can
find same in 1.1

/// <summary>
* * /// This will get user list.
* * /// </summary>
* * protected bool GetSearchUserDa ta()
* * {
* * * * try
* * * * {
* * * * * * //Bind Search UserList grid *as per user entered

* * * * * * string loginName = txtSULoginName. Text;
* * * * * * string firstName = txtSUFirstName. Text;
* * * * * * string lastName = txtSULastName.T ext;

* * * * * * string ActiveDirectory Server =
Convert.ToStrin g(Configuration Manager.AppSett ings["ActiveDirector yServer"])*;

* * * * * *// User that can access domain user details
* * * * * * string ADUserName =
Convert.ToStrin g(Configuration Manager.AppSett ings["ADUserName "]);
* * * * * * string ADUserPassword =
Convert.ToStrin g(Configuration Manager.AppSett ings["ADUserPassword "]);

* * * * * * DirectoryEntry entry = new
DirectoryEntry( ActiveDirectory Server, ADUserName, ADUserPassword) ;
* * * * * * DirectorySearch er ds = new DirectorySearch er(entry);

* * * * * * ds.Filter = "(&(objectClass =user)(objectCl ass=person))";
* * * * * * if (loginName != "")
* * * * * * {
* * * * * * * * ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
* * * * * * * * ds.Filter += "(sAMAccountNam e=" + loginName.Trim( ) +
"*))";
* * * * * * }
* * * * * * if (firstName != "")
* * * * * * {
* * * * * * * * ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
* * * * * * * * ds.Filter += "(givenName =" + firstName..Trim () + "*))";
* * * * * * }
* * * * * * if (lastName != "")
* * * * * * {
* * * * * * * * ds.Filter = ds.Filter.Remov e(ds.Filter.Len gth - 1, 1);
* * * * * * * * ds.Filter += "(sn=" + lastName.Trim() + "*))";
* * * * * * }

* * * * * * dtSearchUserLis t.Columns.Clear ();
* * * * * * dtSearchUserLis t.Columns.Add(n ew DataColumn("Log inName",
typeof(string)) );
* * * * * * dtSearchUserLis t.Columns.Add(n ew DataColumn("Fir stName",
typeof(string)) );
* * * * * * dtSearchUserLis t.Columns.Add(n ew DataColumn("Las tName",
typeof(string)) );

* * * * * * foreach (SearchResult sr in ds.FindAll())
* * * * * * {
* * * * * * * * DataRow row = dtSearchUserLis t.NewRow();
* * * * * * * * string name = sr.Properties["Name"][0].ToString();
* * * * * * * * string firstname = "";
* * * * * * * * string lastname = "";

* * * * * * * * if (name.Length == 0)
* * * * * * * * {
* * * * * * * * * * firstname = "";
* * * * * * * * * * lastname = "";
* * * * * * * * }
* * * * * * * * else if (name.IndexOf(" ,") != -1)
* * * * * * * * {
* * * * * * * * * * iActualLength = name.Length;
* * * * * * * * * * iLength = name.IndexOf(", ") + 2;

* * * * * * * * * * if (iActualLength < iLength)
* * * * * * * * * * {
* * * * * * * * * * * * firstname = "";
* * * * * * * * * * * * lastname = name;
* * * * * * * * * * }
* * * * * * * * * * else
* * * * * * * * * * {
* * * * * * * * * * * * firstname = name.Substring( name.IndexOf(", ") +
2);
* * * * * * * * * * * * lastname = name.Substring( 0,
name.IndexOf(", "));
* * * * * * * * * * }
* * * * * * * * }
* * * * * * * * else if (name.IndexOf(" ") != -1)
* * * * * * * * {
* * * * * * * * * * iActualLength = name.Length;
* * * * * * * * * * iLength = name.IndexOf(" ") + 1;

* * * * * * * * * * if (iActualLength < iLength)
* * * * * * * * * * {
* * * * * * * * * * * * firstname = "";
* * * * * * * * * * * * lastname = name;
* * * * * * * * * * }
* * * * * * * * * * else
* * * * * * * * * * {
* * * * * * * * * * * * lastname = name.Substring( name.IndexOf(" ") +
1);
* * * * * * * * * * * * firstname = name.Substring( 0, name.IndexOf("
"));
* * * * * * * * * * }
* * * * * * * * }
* * * * * * * * else
* * * * * * * * {
* * * * * * * * * * firstname = "";
* * * * * * * * * * lastname = name;
* * * * * * * * }
* * * * * * * * row["FirstName"] = firstname.Repla ce("'", "");
* * * * * * * * row["LastName"] = lastname.Replac e("'", "");
* * * * * * * * row["LoginName"] = sr.Properties["SamAccountName "]
[0].ToString();
* * * * * * * * dtSearchUserLis t.Rows.Add(row) ;
* * * * * * }

* * * * * * if (dtSearchUserLi st != null &&
dtSearchUserLis t.Rows.Count 0)
* * * * * * {
* * * * * * * * dtSearchUserLis t.DefaultView.S ort = "LoginName ASC,
FirstName ASC, LastName ASC";
* * * * * * * * dgADUserList.Da taSource = dtSearchUserLis t;
* * * * * * * * dgADUserList.Da taBind();
* * * * * * * * blSUSearchSuces s = true;
* * * * * * * * lblSUErrorText. Text = "";
* * * * * * }
* * * * * * else
* * * * * * {
* * * * * * * * dtSearchUserLis t.Columns.Clear ();
* * * * * * * * dtSearchUserLis t.Columns.Add(n ew DataColumn("Sel ect",
typeof(string)) );
* * * * * * * * dtSearchUserLis t.Columns.Add(n ew
DataColumn("Log inName", typeof(string)) );
* * * * * * * * dtSearchUserLis t.Columns.Add(n ew
DataColumn("Fir stName", typeof(string)) );
* * * * * * * * dtSearchUserLis t.Columns.Add(n ew
DataColumn("Las tName", typeof(string)) );
* * * * * * * * dgADUserList.Da taSource = dtSearchUserLis t;
* * * * * * * * dgADUserList.Da taBind();
* * * * * * * * lblSUErrorText. Text = ErrorLog.GetTex t("NoUsers");
* * * * * * * * blSUSearchSuces s = false;
* * * * * * }
* * * * }
* * * * catch (Exception ex)
* * * * {
* * * * * * blSUSearchSuces s = false;
* * * * * * TraceSUError.Lo g("\nAn error occurred while fetching user
details.\nExcep tion occurred : " + ex.Message);
* * * * * * strURL = "ErrorPage.aspx ?strErrPageName =SearchUsers.as px";
* * * * * * Response.Redire ct(strURL, false);
* * * * }

* * * * return blSUSearchSuces s;
* * }

Also you can check login user details,

IIdentity WinId = HttpContext.Cur rent.User.Ident ity;
* * * * * * * * WindowsIdentity wi = (WindowsIdentit y)WinId;

* * * * * * * * strDCHLoginID = wi.Name.Split(' \\')[1];
* * * * * * * * hidDHLoginID.Va lue = wi.Name.Split(' \\')
[1];

* * * * * * * * if (ValidLoginUser Data(strDCHLogi nID)) //check user is
present in Database

Regards,
Abhijit B

On May 7, 12:59 pm, "Jon" <rosenb...@main streams.comwrot e:
I am modifying an app for a customer in ASP.Net 1.1. The app is running on
a
server outside their network, yet they want to authenticate users against
their internal active directory set up (they will open the necessary
ports).
So, I have a simple login page with username and password, and then I will
authenticate that credentials entered against their AD server. I am having
a
real hard time figuring this out. We can't use Windows Forms Auth, so I
need
to do it all manually in code.
On the System.Director yServices namespace I can't find what methods I need
to connect to their AD using SSL and then to authenticate the user. I've
found a lot online using Forms Auth and ADAM, but nothing has really fit
what I'm doing.
Could anyone point me to a tutorial or outline what methods, etc I need to
use to accomplish this?
Thank you so much!
Jon- Hide quoted text -

- Show quoted text -
Jun 27 '08 #4
If all you want to do is authenticate the userid/password against AD,
here is a very simple solution:

String ldapPath=
Convert.ToStrin g( ConfigurationMa nager.AppSettin gs["ActiveDirector yServer"] );
String domainAndUserna me = String.Format( "{0}\\{1}", domainName,
userName); // values from login page
try
{
// Authenticate the userName/password against an LDAP server
System.Director yServices.Direc toryEntry dirEntry = new
System.Director yServices.Direc toryEntry( ldapPath, domainAndUserna me,
password );
Object obj = dirEntry.Native Object; // bind to the native object to
force authentication
}
catch(Exception ex)
{
return false;
}
return true;
As Abhijit B mentions, the format of the ldapPath is: "LDAP://
<hostname>".
This technique does not require an admin account.

- Andy
Jun 27 '08 #5

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

Similar topics

5
5801
by: Bud | last post by:
I would like to be able to pass a request to IIS to have a user name and password authenticated against my Active Directory Users database. I'm running Server 2003 however my web pages are build using ASP (not .NET). What I want to do is to open the standard User Name/Password form (I don't know how to do that either) and then make my request and get back a True/False result. There must be a way to do that but I haven't found it after 3...
3
1962
by: GC | last post by:
I'm looking to build a web app that authenticates against my current active directory. Anyone have any examples on how to do this? Thanks!
7
5212
by: Sync Walantaji | last post by:
Hi, I would like to write a asp.net winform program to authenticate users on Active Directory. Can I do this with asp.net if the IIS server is not part of the Active directory domain? Is there a working example link that you can point me to? Thanks
0
3333
by: B111Gates | last post by:
OK I know this is a complex question so I will break it up. I know that SSPI is the prefered method of authentication, however if I use the sample provide by MS I cannot authenticate across domains. Sample Here http://support.microsoft.com/d­efault.aspx?scid=kb;en-us;2798­15 Article ID : 279815
2
1701
by: J-T | last post by:
I need to create a webserivce which is able to talk to the following components: 1) Another webservice which is written by java and talks to its own backend database to authenticate the users 2) Directly talk to a sql server database containg a table to store username and passwords 3) Directoly talks to an Oracle Databse containg a table to store username and passwords 4) Can query our internal Active Directory to authenticate our
0
1192
by: Lajus Norvejikus | last post by:
Hi all, I want to develop a web service to authenticate user/pass against a Active Directory domain. I only don't know how to authenticate the credentials user enters against a AD domain. Anyone knows? Maybe using LDAP? Thanks. Pedro L.
3
26640
by: dorrit.Riemenschneider | last post by:
I need to validate a user with username and password against our OpenLDAP active directory. This is my code: Private bool ValidateUser (string username, string password) { DirectoryEntry userEntry = new DirectoryEntry( ldapPath, username, password, AuthenticationTypes.Anonymous); //Bind to the native AdsObject to force authentication.
1
13230
by: fomalhaut | last post by:
Hi All, I'm builing an application that requires domain admin access to run, and I'm trying to allow for the application to be run as a normal user and allow the user to provide it with a username/password that has the access. I have a method that will check if the username/password is correct, however, it will only authenticate the user running the program...
1
3504
by: Michael Howes | last post by:
I would think this would be very, very easy but in the 50 searches I've done I haven't found anything. If our application requires login and that user/password be a local windows account or more detailed, a user that has been added to the Power Users group that is either a local account or a active directory account how do I authenticate? I've found code that seems to do this against Active Directory
2
5177
by: LIKKLE MAN | last post by:
Can anyone point me to an article that explains how to get an instance of DB2 running on AIX 5.x authenticating against an Active Directory server. There is no issue securing AIX itself in this manner, but is this even possible in the AIX world from a db perspective? Thanks
0
8315
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
8829
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...
0
8734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8608
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
7341
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
5633
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();...
1
2733
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
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.