【问题标题】:How do I set up AD FS 2.0 with a SAML 1.1 profile using Powershell?如何使用 Powershell 使用 SAML 1.1 配置文件设置 AD FS 2.0?
【发布时间】:2013-09-23 19:19:43
【问题描述】:

我正在使用 Windows 2008 R2 Enterprise 服务器。我正在尝试为我们的生产服务器编写依赖方信任的创建脚本。我写了一个powershell脚本。当我手动创建依赖方信任时,我选择 SAML 1.1 配置文件,一切正常。当我创建脚本并使用 powershell 命令Add-ADFSRelyingPartyTrust 时,它的工作方式不同,并且出现以下错误:

联合身份验证服务无法为调用方 'xxxx\xxxxx 授权令牌发行 '。调用者无权为依赖方“https://example.com/forms/”请求令牌。请查看事件 501 与调用者身份相同的实例 id。

当我搜索该错误时,在我看来(尽管我可能是错的)这是一个 SAML 2.0 配置文件问题。但我需要 SAML 1.1。

这是我创建信赖方信任的代码:

Write-Host "Configuring relying party trust."
Add-ADFSRelyingPartyTrust -Identifier "$endpoint" -Name "$name" -WSFedEndpoint "$endpoint/" -SignatureAlgorithm "http://www.w3.org/2000/09/xmldsig#rsa-sha1"
Write-Host "Configuring rules."
$ruleSet = New-ADFSClaimRuleSet -ClaimRule 'c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"), query = ";userPrincipalName,mail,givenName,sn;{0}", param = c.Value);'
Set-ADFSRelyingPartyTrust -TargetIdentifier "$endpoint" -IssuanceTransformRules $ruleSet.ClaimRulesString
Write-Host "Done."

当我对有效的依赖信任执行GetADFSRelyingPartyTrust 并将其与无效的信任进行比较时,请查看规则模板中的差异:

作品:

IssuanceAuthorizationRules : @RuleTemplate = "AllowAllAuthzRule" => 问题(类型 =“http://schemas.microsoft.com/authorization/claims/permit”,Val ue = "真");

不起作用:

IssuanceAuthorizationRules:

关于如何摆脱上述错误信息的任何想法?

【问题讨论】:

    标签: powershell windows-server-2008 adfs2.0 adfs


    【解决方案1】:

    通过提出问题并提供上述信息,我找到了自己的答案:

    我需要将 -IssuanceAuthorizationRules 参数传递给命令。

    -IssuanceAuthorizationRules '@RuleTemplate = "AllowAllAuthzRule" => issue(Type = "http://schemas.microsoft.com/authorization/claims/permit", Value = "true");'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-14
      • 1970-01-01
      • 1970-01-01
      • 2018-07-04
      • 1970-01-01
      • 2011-01-30
      • 2018-05-19
      • 1970-01-01
      相关资源
      最近更新 更多