开发者

Sharepoint 2010 API for adding new Trusted Identity Token Issuer

开发者 https://www.devze.com 2023-01-06 06:10 出处:网络
Does anyone know a Sharepoint 2010 API for adding a new trusted identity token issue开发者_StackOverflow中文版r (aka identity provider)?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消