- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 B2C 自定义策略将 B2C 配置为我的 SAML Idp。作为测试,我将本地 ADFS 环境设置为 SAML RP,这似乎是 B2C 登录页面正常工作所必需的(B2C SAML 不支持 Idp 发起的 session )。
我一直在遵循 https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-get-started-custom 上的指南和 https://github.com/Azure-Samples/active-directory-b2c-advanced-policies/blob/master/Walkthroughs/RP-SAML.md设置我的 B2C 环境。
我尽可能显示最终用户收到的 B2C 登录页面,但是在我将帐户的凭据输入到 B2C 登录页面后,我会使用 SAML token 重定向回我的 RP,但是它不解析任何配置的声明。SAML token 显示以下错误:
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Responder" />
<samlp:StatusMessage>Id:410906d7-639d-4828-b28d-22f84dfa617b ; Message: Policy 'B2C_1A_signup_signin_saml' in tenant ' mytenant.onmicrosoft.com'' specifies the claim 'sub' for the SubjectNamingInfo, but the claim is either not present or is null.</samlp:StatusMessage>
<IsPolicySpecificError>true</IsPolicySpecificError>
</samlp:Status>
我的SignUpOrSigninSaml.xml RP配置如下:
<RelyingParty>
<DefaultUserJourney ReferenceId="SignUpOrSignInSaml"/>
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="SAML2" />
<Metadata>
<Item Key="PartnerEntity">https://adfs-test.mycorporation.com.au/FederationMetadata/2007-06/FederationMetadata.xml</Item>
<Item Key="KeyEncryptionMethod">Rsa15</Item>
<Item Key="DataEncryptionMethod">Aes256</Item>
<Item Key="XmlSignatureAlgorithm">Sha256</Item>
</Metadata>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="displayName" />
<OutputClaim ClaimTypeReferenceId="givenName" />
<OutputClaim ClaimTypeReferenceId="surname" />
</OutputClaims>
<!-- The ClaimType in the SubjectNamingInfo element below is a reference to the name of the claim added to the claims bag used by the token minting process.
This name is determined in the following order. If no PartnerClaimType is specified on the output claim above, then the DefaultPartnerClaimType for the protocol specified in the claims schema if one exists is used, otherwise the ClaimTypeReferenceId in the output claim is used.
For the SubjectNamingInfo below we use the DefaultPartnerClaimType of http://schemas.microsoft.com/identity/claims/objectidentifier, since the output claim does not specify a PartnerClaimType. -->
<!-- <SubjectNamingInfo ClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="true"/> -->
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>
我尝试了“SubjectNamingInfo”的几种不同配置,例如:
<SubjectNamingInfo ClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="true"/>
<SubjectNamingInfo ClaimType="sub" />
<SubjectNamingInfo ClaimType="name" />
但是它们都会产生相同的错误。
我相信,一旦对SubjectNamingInfo问题进行排序,配置的OutputClaims就会显示。
有人知道如何解决这个问题,以便我能够在 token 中看到我的用户帐户的声明吗?
---编辑---
我尝试添加“sub”作为输出声明,但是由于它没有在基本文件中定义,B2C 不允许这样做。或者,我尝试将主题命名信息更改为已定义为输出声明的声明
<SubjectNamingInfo ClaimType="givenName" />
但是我似乎仍然遇到同样的错误:
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Responder" />
<samlp:StatusMessage>Id:a3fe7ab0-4483-45b6-93f8-e75b539a3aea ; Message: The relying party technical profile of policy 'mytenant.onmicrosoft.com' in tenant 'B2C_1A_signup_signin_saml' specifies the claim type 'givenName' as the subject naming info claim, but the claim is not present or is null.</samlp:StatusMessage>
<IsPolicySpecificError>true</IsPolicySpecificError>
最佳答案
使用 sub 声明作为 <saml:Subject><saml:NameID>
的情况并不常见SAML 断言的元素。
建议按如下方式使用 objectId 声明。
1) 确保使用 SAML2 协议(protocol)的合作伙伴声明声明 objectId 声明:
<ClaimType Id="objectId">
<DisplayName>Object Identifier</DisplayName>
<DataType>string</DataType>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="oid" />
<Protocol Name="OpenIdConnect" PartnerClaimType="oid" />
<Protocol Name="SAML2" PartnerClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" />
</DefaultPartnerClaimTypes>
</ClaimType>
2) 将 objectId 声明添加到 <OutputClaims />
收集依赖方技术概况并设置SubjectNamingInfo
元素:
<RelyingParty>
<TechnicalProfile Id="PolicyProfile">
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" />
<OutputClaim ClaimTypeReferenceId="displayName" />
<OutputClaim ClaimTypeReferenceId="givenName" />
<OutputClaim ClaimTypeReferenceId="surname" />
</OutputClaims>
<SubjectNamingInfo ClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="true"/>
</TechnicalProfile>
</RelyingParty>
有关SubjectNamingInfo的更多信息
SubjectNamingInfo 元素的 ClaimType 属性引用必须声明为技术配置文件的输出声明的声明类型。
此声明类型按名称引用,优先级如下:
1) 如果指定了 OutputClaim 元素的 PartnerClaimType 属性,则指定 SubjectNamingInfo 的 ClaimType 属性> 元素必须设置为此 OutputClaim 元素的 ClaimTypeReferenceId 属性:
<RelyingParty>
<TechnicalProfile Id="PolicyProfile">
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" />
...
</OutputClaims>
<SubjectNamingInfo ClaimType="objectId" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="true"/>
</TechnicalProfile>
</RelyingParty>
2) 如果未指定 OutputClaim 元素的 PartnerClaimType 属性,则指定 SubjectNamingInfoClaimType 属性strong> 元素必须设置为 ClaimType 元素的 DefaultPartnerClaimType 属性,该元素由该 OutputClaimClaimTypeReferenceId 属性引用强>元素:
<ClaimType Id="objectId">
<DefaultPartnerClaimTypes>
<Protocol Name="SAML2" PartnerClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" />
</DefaultPartnerClaimTypes>
</ClaimType>
<RelyingParty>
<TechnicalProfile Id="PolicyProfile">
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" />
...
</OutputClaims>
<SubjectNamingInfo ClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="true"/>
</TechnicalProfile>
</RelyingParty>
关于saml-2.0 - B2C SAML 缺失声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49669435/
我编写了一个 Android 应用程序,它使用 Azure 来执行用户通过 Google、Twitter 和 Facebook 的登录;它使用 Microsoft.WindowsAzure.Mobil
我想将 AdomdClient 引用添加到 C# 项目,但它不在引用列表中。客户端列在程序集文件夹 C:\Windows\Assembly 中。 计算机上安装了 SQL Server 2012。 最佳
我正在学习“绘图应用程序”的教程。当我在 Firefox 上启动我的应用程序时,Firebug 告诉我“在语句之前缺少 ;” 我在第 9 行调用函数的位置。我只是不明白应该将这些“;”放在哪里. va
我想将 AdomdClient 引用添加到 C# 项目,但它不在引用列表中。客户端列在程序集文件夹 C:\Windows\Assembly 中。 计算机上安装了 SQL Server 2012。 最佳
我在 Firebug 中不断收到关于 onClick 事件的错误。 我已经尝试了 "和 ' 的各种不同组合,但无济于事。在添加 onClick 事件之前,这工作正常。 有人能发现我可能做错了什么吗?
Visual Studio 2015 告诉我找不到 WSASetSocketSecurity。 该 dll 存在并且还包括似乎没问题。 我的包括: windows.h stdio.h Wincrypt
我需要访问 eloquent 的 whereHasNot方法(此处添加: https://github.com/laravel/framework/commit/8f0cb08d8ebd157cbfe
跟随宠物物体检测的 TF 教程:https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/run
构建路径 > 添加库 > JUnit 无法添加 JUnit3 或 JUnit4 组件。 我在.log 中看到这样的消息 !MESSAGE No property tester contributes
我正在运行此脚本来查看网络上的摄像机: gst-launch udpsrc port=1234 ! "application/x-rtp, payload=127" ! rtph264depay !
我正在使用http://java.sun.com/jsp/jstl/fmt用于从 Spring 配置中设置的 Message Resource Bundle 输出消息的标签库。消息解析也可以放在 Co
我正在将 Ninject 与 MVC4 连接起来,并让它工作到尝试实际解决依赖关系的程度。但是,我收到以下异常: Method not found: 'System.Web.Http.Services
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 9 年前。 Improve
我在启动 ASP.NET MVC5 应用程序时遇到问题。到目前为止一切正常。启动应用程序时出现以下错误: Could not load file or assembly 'Microsoft.Appl
我已经使用以下方法创建了一个环境: conda create --prefix C:\Users\Dell\Dropbox\DjangoProjects\webenv python=3.6 执行后:c
我们有一个遗留的 Web 窗体应用程序,我们最近将其从网站项目转换为 Web 应用程序项目。 Web 窗体项目是解决方案的“启动”项目。 有一个 MVC 项目是对 Web 窗体项目的引用。 在 MVC
使用某种字体,我使用Java的FontLayout来确定它的上升、下降和行距。 (参见 Java 的 FontLayout 教程 here) 在我的具体案例中,我使用的是 Arial Unicode
我正在尝试在 linux 下编译 qt ffmpeg 包装器简单编码/解码示例 QTFFmpegWrapper source # Set list of required FFmpeg librari
我正在使用来自开发人员 android 页面的 SlidingTabLayout.java。在我使用 slidingTabLayout.setDistributeEvenly(true); 使 sli
我正在尝试使用 v360 filter 将 180° 鱼眼视频转换为普通/常规视频的 FFmpeg . 这是我尝试过的命令:ffmpeg -i in.mp4 -vf "v360=input=fishe
我是一名优秀的程序员,十分优秀!