Sharepoint 2010 API for adding new Trusted Identity Token Issuer
Does anyone know a Sharepoint 2010 API for adding a new trusted identity token issue开发者_StackOverflow中文版r (aka identity provider)?
I can do this using the PS cmdlet New-SPTrustedIdentityTokenIssuer, but I need to do it from C# code.
If you open Microsoft.SharePoint.Powershell.dll in .Net Reflector it reveals that the implementation if SPCmdletNewTrustedServiceTokenIssuer is:
protected override SPTrustedAccessProvider CreateDataObject()
{
SPSecurityTokenServiceManager localOrThrow = SPSecurityTokenServiceManager.LocalOrThrow;
SPTrustedAccessProvider newObj = new SPTrustedAccessProvider(localOrThrow, this.Name, this.Description, this.Certificate);
localOrThrow.TrustedAccessProviders.Add(newObj);
return newObj;
}
SPSecurityTokenServiceManager.LocalOrThrow is internal but just calls Local
精彩评论