HttpConfiguration不包含“ Saml”的定义

时间:2019-02-14 14:58:26

标签: c# asp.net single-sign-on saml-2.0

我找到了以下示例,说明如何将Web App设置为Salesforce Setup SSO的身份提供程序。但是在代码'HttpConfiguration' does not contain a definition for 'Saml' and no accessible extension method 'Saml' accepting a first argument of type 'HttpConfiguration' could be found (are you missing a using directive or an assembly reference?)的以下部分出现错误“ (Configuration.Saml)”。谁知道它可以修复吗?

public class SamlController : Controller
{
    public string Assertion()
    {
        return new SamlAssertion(
            Assembly.GetExecutingAssembly().GetEmbeddedResource("mycert.pfx"),
            Configuration.Saml.Issuer,
            Configuration.Saml.EntityId,
            Configuration.Saml.SalesforceLoginUrl,
            Configuration.Saml.IdentityProviderLoginUrl,
            Configuration.Saml.IdentityProviderLogoutUrl)
            .Create(Token.Current.Username);
    }
}

0 个答案:

没有答案