Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9293859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:14:23+00:00 2026-06-18T21:14:23+00:00

I have an interesting issue I’ve been trying to resolve for a few days.

  • 0

I have an interesting issue I’ve been trying to resolve for a few days.

I’m currently working with an Windows Server 2003 machine that is running a standard instance of Active Directory.

The directory contains two domain components (DCs) that both house users that are going to be authorizing against the directory, via my application.

I’m using :

  • The IP address of the server as the host name
  • An SSL connection via port 3269
  • The GSS Negotiate Auth Mechanism
  • A BaseDN that is a parentDN of both DC’s
  • The sAMAccountName as the login name

The problem is, I cannot successfully authorize any users from DC1, yet all of the ones who belong to DC2 are completely fine and work great. I get this error on DC1 :

8009030C: LdapErr: DSID-0C09043E, comment: AcceptSecurityContext error, data 0, vece
System.DirectoryServices.Protocols.LdapException: The supplied credential is invalid.

However, using Softerra’s LDAP Broswer, I can connect in and authorize the same exact user without any issue, so I know the credentials are correct.

From what I can tell, both of these DC’s are configured the same… I’ve browsed both of them for something, anything that is different… but have found nothing that really stands out.

I posted something months ago about this particular setup, and the code I’m using is in that thread as well.

Set callback for System.DirectoryServices.DirectoryEntry to handle self-signed SSL certificate?

Any help here would be much appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T21:14:25+00:00Added an answer on June 18, 2026 at 9:14 pm

    I was able to get this working, but for the life of me I cannot figure out why this was the case. Basically, this error…

    8009030C: LdapErr: DSID-0C09043E, comment: AcceptSecurityContext error, data 0, vece    System.DirectoryServices.Protocols.LdapException: The supplied credential is invalid.
    

    …was dead on. The issue was that users logging in under what I called DC2 needed to issue the bind with the domain AND sAMAccountName (Ex. LIB\JSmith), as opposed to DC1, which allowed just the sAMAccountName to be entered.

    I figured the best way to make this programmatic was to use the principal binding account to query for the DN of the user. From that DN, using some crafty RegEx, I’m able to capture the domain they inherit from, and issue two separate binds.

    SearchResultEntry ResultEntry = userResponse.Entries[0];
    
    //Let's get the root domain of the user now using our DN RegEx and that search result
    Regex RegexForBaseDN = new Regex(config.LdapAuth.LdapDnRegex);
    Match match = RegexForBaseDN.Match(ResultEntry.DistinguishedName);
    string domain = match.Groups[1].Value;
    
    //Try binding the user with their domain\username
    try
    {
        var thisUser = new NetworkCredential{
                                             Domain = domain, 
                                             UserName = username, 
                                             Password = Pin
                                            };
    
         //If this goes well, we'll continue forward
         ldapconn.Bind(thisUser);
    }
    
    //If that doesn't work, try biding them with the highest level domain
    catch (LdapException ex)
    {
         if (ex.ErrorCode.Equals(LdapErrorCodes.LDAP_INVALID_CREDENTIALS))
         {
              var thisUserOnce = new NetworkCredential{
                                                       Domain = config.LdapAuth.LdapDomain,
                                                       UserName = username,
                                                       Password = Pin
                                                      };
    
              //If this goes well, we'll continue forward
              ldapconn.Bind(thisUserOnce);
          }
     }
    

    It’s not nearly as elegant as I would have wanted, but it does work for this particular scenario.

    However, I’m still really interested in why the naming conventions are different depending on which DC the user inherit’s from.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a db (SQL server 2008), and have an interesting issue with
I have an interesting issue which I have not been able to resolve. I
Someone please help. I have an interesting issue. I am trying to implement an
I have ran into an interesting issue while trying to create a more usable
I have run into an interesting issue trying to upgrade one of my applications
I have encountered an interesting issue in which I have my master trying to
I have a quite interesting issue. I set some values on the server, send
I am facing an interesting issue: Currently I have a button that says Print,
I have an interesting issue going on with trying to understand and improve my
We have been having an interesting issue with the Eclipse update when some of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.