Been mulling something over with regards to CBA in 2010.
Suppose that I have a trusted IdP. A user authenticates against the IdP and enters my SharePoint site for the first time.
Unless the user has already been given a role assignment, the user won't have access to the site. Seems like a Catch-22 (or am I wrong?). Q1. Would it be possible to provision the SPUser
and the role assignments without building a custom MembershipProvider
? I am assuming this is a "No" and that a custom MembershipProvider
and access to query the IdP's membership store is required. More generally, how does a CBA user get access to the site in the first place?
Now suppose my IdP also provides a series of claims regarding the user. For example:
- Display Name
- Country
- Project
- Role
And based on the claims, I would like to use custom code to automatically build the role assignments when the user first logs into the SharePoint site. For example, a user with claims {Country=US,Project=PROJ1,Role=Manager}
would be provisioned to a sub-site for "PROJ1" in the group "US Managers".
From what I understand, the correct way to do this would be to implement a custom Microsoft.IdentityModel.Claims.ClaimsAuthorizationManager
and inserting that into the request pipeline to provision the role assignments automatically in custom code from the claims. The CAM would execute before SharePoint in the request pipeline and thus it would have a chance to provision the user to the site.
Q2. Is this the best way? Or is there a simpler solution/alternate extension point?