Question is pretty simple: when implementing a custom
SPClaimProvider in 2010, do the claims have to be known at provider install time?
I had been spinning around getting nowhere trying to implement a custom claims provider. I could get the people picker to show my claims and generated hierarchy nodes and
PickerEntity instances just fine, but the selections didn't "stick" in people picker once I clicked "Add" and "OK".
To that point, I had been dynamically generating the claim types in the call to
FillClaimTypes. However, I finally noticed that there was an error during on install pass when the feature was activating -- the
FillClaimTypes method raised an error because it couldn't connect to the datasource to generate the dynamic claim types. More importantly, when I created a
SPClaim instance for the
PickerEntity, I always received
SPClaim.ToEncodedString() which caused the people picker control to misbehave.
So this raised the thought: hmm -- seems like the claim types are read at install time via a call to
FillClaimTypes and the claim type MUST be registered at this time.
Indeed, once I switched to hard-coded claim types at install-time, I was able to get it all working right. So I wonder if it can be confirmed that the claims are registered at install time per claim provider. If so, are there other ways around this? Ideally, I'd like to be able to dynamically create claim types over the lifetime of the system without having to re-install the claim provider.