locked
Cannot figure out for the life of me how to connect successfully to AD on my server RRS feed

  • Question

  • User1968586829 posted

    I am using this: http://msdn.microsoft.com/en-us/library/ms998360.asp as something to go off of, but cant seem to get it to work.

     Basically all I want to do it just validate if a user is in the AD or not to get authenticated.  So I have a AD structure like this: domain.local>MyBusiness>Users>SBSUsers

     My connection string looks like this:

    <connectionStrings>

    <add name="ADConnectionString" connectionString=LDAP://myserverIP.com:389/OU=SBSUsers,OU=Users,OU=MyBusiness,DC=domain,DC=local />

    </connectionStrings>

     And I keep getting this error:

    Server Error in '/WebSite1' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: The format of the specified network name is invalid.


    Source Error:

    Line 39:           <add
    Line 40:              name="MyADMembershipProvider"
    Line 41:              type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
    Line 42:              Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Line 43:              connectionStringName="ADConnectionString"

    Source File: C:\Documents and Settings\Justin Huntington\Desktop\WebSite1\web.config    Line: 41


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

     

    Can anyone help me please? Thank you very much!<!-- [ConfigurationErrorsException]: The format of the specified network name is invalid. (C:\Documents and Settings\Justin Huntington\Desktop\WebSite1\web.config line 41) at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType) at System.Web.Security.Membership.Initialize() at System.Web.UI.WebControls.LoginUtil.GetProvider(String providerName) at System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) at System.Web.UI.WebControls.Login.AttemptLogin() at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.login_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

    Sunday, April 15, 2007 8:17 AM

All replies

  • User-319574463 posted

    Get a copy of BEAVERTAIL from http://adsi.mvps.org/adsi/csharp/beavertail.html and look at AD using that. - You are possibly addressing the domain incorrectly.

     

    Sunday, April 15, 2007 1:50 PM
  • User1968586829 posted

    Ok great....that helped a little bit, so now I am getting a slightly different error than before.

     I basically logged into the domain with the utility, and navigated thru the heirarchy to the administrator user and got the proper address for it.

     Now the error I receive is:

    Server Error in '/WebSite1' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: User objects cannot be created in the specified container.

    Source Error:

    Line 39:           <add
    Line 40:              name="MyADMembershipProvider"
    Line 41:              type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, 
    Line 42:              Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Line 43:              connectionStringName="ADConnectionString"

    Source File: C:\Documents and Settings\Justin Huntington\Desktop\WebSite1\web.config    Line: 41


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

     

     

    Its saying the user object cannot be created, but really all the code does is this:

    protected void Page_Load(object sender, EventArgs e)

    {

    Response.Write("Hello, " + Server.HtmlEncode(User.Identity.Name));

    FormsIdentity id = (FormsIdentity)User.Identity;

    FormsAuthenticationTicket ticket = id.Ticket;

    Response.Write("<p/>TicketName: " + ticket.Name);

    Response.Write("<br/>Cookie Path: " + ticket.CookiePath);

    Response.Write("<br/>Ticket Expiration: " +

    ticket.Expiration.ToString());

    Response.Write("<br/>Expired: " + ticket.Expired.ToString());

    Response.Write("<br/>Persistent: " + ticket.IsPersistent.ToString());

    Response.Write("<br/>IssueDate: " + ticket.IssueDate.ToString());

    Response.Write("<br/>UserData: " + ticket.UserData);

    Response.Write("<br/>Version: " + ticket.Version.ToString());

    }

     Im so lost...thanks again for the help.

    <!-- [ConfigurationErrorsException]: User objects cannot be created in the specified container. (C:\Documents and Settings\Justin Huntington\Desktop\WebSite1\web.config line 41) at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType) at System.Web.Security.Membership.Initialize() at System.Web.UI.WebControls.LoginUtil.GetProvider(String providerName) at System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) at System.Web.UI.WebControls.Login.AttemptLogin() at System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.login_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

    Sunday, April 15, 2007 7:53 PM
  • User1968586829 posted

    more progress...no I am getting a: cannot establish a secure connection with the server.

     

    I have looked everywhere but cannot find anymore info on this? Anyone with any expertise? Thanks!

    Sunday, April 15, 2007 8:30 PM
  • User-319574463 posted

    I suggest you do the following:

    1. Ensure that your error handling checks for inner exception - the example of WriteError in my posting on the thread http://forums.asp.net/thread/1631102.aspx.
    2. Check all the event logs on the machine that is doing the calling.
    3. Get your network support to check the event logs on your domain controllers
    4. If the above fail, post another enquiry stating the problem as clearly and completely as possible.
    Monday, April 16, 2007 3:57 PM
  • User203533900 posted

    jdub12,

    How did you resolve this:

    Parser Error Message: User objects cannot be created in the specified container.

    I'm having the same at this time, could use a hint or two!

    Thanks -

    Thursday, June 14, 2007 10:13 AM