Coder Social home page Coder Social logo

Augmentation with Ldap Issue about ldapcp HOT 5 CLOSED

yvand avatar yvand commented on August 10, 2024
Augmentation with Ldap Issue

from ldapcp.

Comments (5)

Yvand avatar Yvand commented on August 10, 2024

Hello,
when you leave the LDAPCP admin page and return to it, can you confirm that the check box "This is an Active Directory server, use UserPrincipal.GetAuthorizationGroups" remains unchecked?
Did you try to refresh the non-interactive token in a new PowerShell process, that you start after you changed the setting?

from ldapcp.

Bastien-RB avatar Bastien-RB commented on August 10, 2024

Yes the box is unchecked after come back
the lifetime is 1 minute

from ldapcp.

Bastien-RB avatar Bastien-RB commented on August 10, 2024

I cleared the sharepoint cache on the Front end (C:\ProgramData\Microsoft\SharePoint\Config) And Its resolved the problem thanks for you help

from ldapcp.

Yvand avatar Yvand commented on August 10, 2024

Sure, thanks ! :)

from ldapcp.

sergey-tihon avatar sergey-tihon commented on August 10, 2024

One important NOTE for everyone who troubleshoot augmentation.

Important note

Following LDAP server connection is incorrect (even if Test LDAP connection works)
ldapcp_configuration

you should use distinguished name of LDAP server
ldapcp_configuration

What's going on

0x80005000 means An invalid ADSI pathname was passed. (Verify that the object exists on the directory server and check for typographic errors of the path.)

If you take a look at the code

public static void GetDomainInformation(string distinguishedName, out string domainName, out string domainFQDN)
{
// Retrieve FQDN and domain name of current DirectoryEntry
domainName = domainFQDN = String.Empty;
if (distinguishedName.Contains("DC="))
{
int start = distinguishedName.IndexOf("DC=", StringComparison.InvariantCultureIgnoreCase);
string[] dnSplitted = distinguishedName.Substring(start).Split(new string[] { "DC=" }, StringSplitOptions.RemoveEmptyEntries);
bool setDomainName = true;
foreach (string dc in dnSplitted)
{
domainFQDN += dc.Replace(',', '.');
if (setDomainName)
{
domainName = dc.Trim(new char[] { ',' });
setDomainName = false;
}
}
}
}

you will see that LDAPCP build domainFQDN using DCs, if they omitted domainFQDN will be equal to String.Empty and when you turn on This is an Active Directory server, use UserPrincipal.GetAuthorizationGroups on this LDAP Server you will see following error in logs

[LDAPCP] Unexpected error occurred while getting AD groups of user [email protected] in LDAP://my.domain.com using UserPrincipal.GetAuthorizationGroups(): System.Runtime.InteropServices.COMException: Unknown error (0x80005000), Callstack:   
 at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)    
 at System.DirectoryServices.DirectoryEntry.Bind()    
 at System.DirectoryServices.DirectoryEntry.get_AdsObject()    
 at System.DirectoryServices.PropertyValueCollection.PopulateList()    
 at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName)    
 at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)    
 at System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()    
 at System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit()    
 at System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()    
 at System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()    
 at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate)    
 at System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue)    
 at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, String identityValue)    
 at ldapcp.LDAPCP.GetGroupsFromActiveDirectory(LDAPConnection ldapConnection, OperationContext currentContext, ClaimTypeConfig groupCTConfig)

@Yvand do not you mind to mention it in docs? or even better, improve Test LDAP connection validation?

from ldapcp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.