Yvand / LDAPCP

A claims provider to connect SharePoint Subscription / 2019 / 2016 with Active Directory and LDAP directories in federated authentication
https://ldapcp.com
Apache License 2.0
57 stars 25 forks source link

Using Custom LDAPCP wsp and standard LDAPCP wsp #193

Closed weswilliams901 closed 5 months ago

weswilliams901 commented 1 year ago

I have two Trusts deployed in SPSE. Since LDAPCP can't be used with both Trust, we created a custom wsp using ldapcp. I have deployed both wsp to the farm, However, LDAPCP is the CP showing up in the claim provider list via powershell. Both solutions are shown deployed in the solution store.

what is the proper way to deploy both wsps to show up as claim providers? Could there be a conflict with one wsp being the parent?

Yvand commented 1 year ago

@weswilliams901 can you download LDAPCP.Developers.zip to see how to create a custom version of LDAPCP?

Note that the next version will significantly change the implementation, and will come with a Nuget package that will allow you to easily create your custom version. I cannot give you any ETA on when this will be puslibhed, unfortunately

weswilliams901 commented 1 year ago

Ok. Sorry I should have mentioned it better. We have the custom solution already created via LDAPCP.Developers.zip. The problem we are having is when standard LDAPCP deployed and the custom LDAPCP solution deployed at the same time, only the standard LDAPCP solution is showing up as a claim provider via get-spclaimprovider.

However, both solutions show up in the solution store in Manage Farm Solutions and both features are are shown and active.

Is there a readme on how to deploy both of them to get to work. We are doing normal SharePoint deployment of the wsp. So is this a MS support or is there conflict between the ldapcp wsps?

Yvand commented 1 year ago

Ok, so both WSP file can be deployed in parallel, but you must be careful that both use exactly the same version of ldapcp.dll. And by version I do not mean the .NET version, which is always 1.0.0.0, but the file version which you can see in the properties of the DLL.

Also, in SharePoint, a claims provider is installed by a farm feature, so you need to validate if the farm feature corresponding to your solution was activated. You can see it in the central administration > System Settings > Farm features

yongkim1216 commented 1 year ago

Hi Yvand, My name is Yong and I work with weswilliams901. Joining this conversation to ask a question.

I've built developer.zip solution, deployed, and activated feature. I see it as claims provider with Get-SPClaimProvider. When I try to update configuration via PowerShell, $config = [ldapcp.LDAPCPConfig]::GetConfiguration("LDAPCPConfig") returns null $config. I did not rename the name of the configuration. So thinking it should be "LDAPCPConfig"

Could you point us to the direction where we can take a look.

Thank you,

Yong

Yvand commented 1 year ago

Hi @yongkim1216, each claims provider has its own configuration, so you cannot use the persisted object "LDAPCPConfig" because it belongs to the standard LDAPCP. In the sample project, you can see in class LDAPCP_Custom that property PersistedObjectName is set with a custom value in class CustomConfiguration. This is basically the pattern you should use. Is this what you are doing?

FYI I just uploaded an updated version of LDAPCP.Developers.zip, compiled with the latest version of LDAPCP

yongkim1216 commented 1 year ago

Hi Yvand, thank you for the updated sample code. Very helpful. Yes that (using CustomConfiguration class to use "MyCustomLDAPCPConfig" as persisted object name) is what we are doing.

I've noticed in the EventReceiver.cs, the following code. Could you confirm the claim provider needs to be associated with a trust in order for the object to be persisted?

if (spTrust != null) { LDAPCPConfig existingConfig = LDAPCPConfig.GetConfiguration(CustomConfiguration.CONFIG_NAME); if (existingConfig == null) LDAPCPConfig.CreateConfiguration(CustomConfiguration.CONFIG_ID, CustomConfiguration.CONFIG_NAME,spTrust.Name); else ClaimsProviderLogging.Log($"[{CustomConfiguration.ClaimsProviderName}] Use configuration \" {CustomConfiguration.CONFIG_NAME}\" found in the configuration database", TraceSeverity.High, EventSeverity.Information, ClaimsProviderLogging.TraceCategory.Configuration); } Thank you,

Yong

Yvand commented 1 year ago

No, those are 2 different things. Let me clarify:

yongkim1216 commented 12 months ago

Thank you very much! We will give that a try.

Yong

Yong Kim Software Developer Microsoft Solutions 15231 Avenue of Science Ste 100 / San Diego CA 92128 Office: (571)508-5222 Mobile: (909) 614-9387

Planned OOO: 11/10/2023

@.***

From: Yvan Duhamel @.> Sent: Wednesday, November 8, 2023 1:26 AM To: Yvand/LDAPCP @.> Cc: Kim, Yong (PERATON) @.>; Mention @.> Subject: [EXTERNAL] Re: [Yvand/LDAPCP] Using Custom LDAPCP wsp and standard LDAPCP wsp (Issue #193)

No, those are 2 different things. Let me clarify:

— Reply to this email directly, view it on GitHubhttps://github.com/Yvand/LDAPCP/issues/193#issuecomment-1801400374, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BDXF65S422IGE6YJBJGZ5Y3YDNF3JAVCNFSM6AAAAAA6WF64WKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBRGQYDAMZXGQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

github-actions[bot] commented 8 months ago

Stale issue message