- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何使用标准的 visual studio web.config 转换来转换 microsoft.identitymodel 配置部分中的 audienceUris 和 federatedAuthentication 元素?
对于开发环境,我们将所有子域都以“-dev”作为后缀以及特殊的本地主机端口号,例如:realm="https://client-dev.domain.com:444"。今天主要的 web.config 反射(reflect)了这一点,但理想情况下,我们希望将此设置移动到 Web.Debug.config 中,在 Web.Release.config 中,我们希望指定适当的受众和领域,没有“-dev”后缀和本地端口设置。但是,尝试将 xdt:Transform="Replace"放在 Web.Debug.Config 内的 microsoft.identitymodel 元素中会导致此警告:
The 'http://schemas.microsoft.com/XML-Document-Transform:transform' attribute is not declared.
当然还有运行时故障(例如无法找到服务证书)。
这是 microsoft.identitymodel 部分:
<configuration>
<configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<microsoft.identityModel>
<service>
<applicationService>
<claimTypeRequired>
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" optional="false" />
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" optional="false" />
</claimTypeRequired>
</applicationService>
<serviceCertificate>
<certificateReference x509FindType="FindByThumbprint" findValue="NNNNNNNNNN" storeLocation="LocalMachine" storeName="My" />
</serviceCertificate>
<certificateValidation certificateValidationMode="None" />
<audienceUris>
<add value="https://url/" />
</audienceUris>
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="https://url/" realm="https://url/" requireHttps="true" />
<cookieHandler requireSsl="true" />
</federatedAuthentication>
<issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<trustedIssuers>
<add thumbprint="NNNNNNNNNN" name="https://url/" />
</trustedIssuers>
</issuerNameRegistry>
</service>
</microsoft.identityModel>
<configuration>
现有的不起作用的解决方案:
1) 这里提出了同样的问题,但没有适当的回应。 RemoveAll 和 Insert 不起作用: Web config transform on microsoft.identityModel - 'http://schemas.microsoft.com/XML-Document-Transform' attribute is not declared
2) 此外,尝试按照此线程中的建议操作命名空间,但这也不起作用: http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9ededb66-3e34-4bba-8e20-a2cc6025f0f9
3) configSource 看起来很有前途,但在 microsoft.identitymodel 元素中指定时再次起作用。我得到:
Warning 1 The 'configSource' attribute is not declared.
http://blog.andreloker.de/post/2008/06/16/Keep-your-config-clean-with-external-config-files.aspx
任何帮助将不胜感激!谢谢。
最佳答案
经过大量试验和错误后,我求助于使用 Loren Halvorson 的 XMLPreProcess 从 TemplateWeb.config 自动生成正确的 Web.config 作为每个项目预构建事件的一部分。
虽然我希望 Visual Studio 在这方面的尝试能为开发人员服务,唉,时间就是金钱,是时候让我继续前进了。不用说,它在 SQL Azure SDK 中也被破坏了,因为转换仅在您发布站点时发生。在最新的 Azure SDK 中,情况不再如此,因此转换也停止工作。哦快乐!
这是我认为是每个 ASP.NET 开发人员必备的优秀工具的链接:
关于asp.net - web.config 转换为 microsoft.identitymodel 配置部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12667742/
我正在使用 Forms Authentication 和 ASP.NET MVC 2 开发一个基于声明的授权系统。我看到一个命名空间“Microsoft.IdentityModel”提供了很多与另一个
我在使用 System.IdentityModel.Tokens 时遇到冲突: using System; using System.Configuration; using System.Data;
我可能不是第一个问但我们现在应该使用哪个?据我了解,它从一个非常小的 开始。系统 .IdentityModel 用于 WCF。然后是微软 .IdentityModel 类增加了很多。这是 http:/
我开始在我的项目中使用 ThinkTecture.IdentityModel,但我遇到了一个严重的问题。请帮助我。 错误 1“类型‘System.IdentityModel.Tokens.Securi
在遵循教程时 Create a RESTful API with authentication using Web API and Jwt我在编译 CustomJwtFormat 类时遇到问题: us
我们可以在 NuGet 库中找到两个独立的包: System.IdentityModel.Tokens.Jwt Microsoft.IdentityModel.Tokens 两者似乎都会定期更新并拥有
使用 .net 4.7 和 IdentityModel 的 Windows 服务应用程序。这是一个 Windows 服务:它在我的机器 (Windows 10) 上运行良好,但在 Windows Se
我是 .NET 的新手,目前正在通过关注 this tutorial 学习 ASP.NET Core MVC . 我的开发环境: Ubuntu 16.04.1 LTS .Net Core 1.0.0-
构建时我不断收到此错误: 无法识别的配置部分 system.identityModel 我已将以下内容添加到我的配置中:
我正在尝试在SharePoint Foundation 2010项目中使用 SPFederationAuthenticationModule 类。\我找不到 Microsoft.Sharepoint.
我已经更新了 System.IdentityModel.Tokens.jwt,它警告我在较低的代码块中使用“Audience”已过时。我做了一些研究,发现让观众前进的正确方法是: var valida
我已经更新了 System.IdentityModel.Tokens.jwt,它警告我在较低的代码块中使用“Audience”已过时。我做了一些研究,发现让观众前进的正确方法是: var valida
我已安装 Windows Identity Foundation,但找不到 Microsoft.IdentityModel dll。根据 Azure 动手实验室,它应该只是在 VS2010 中的“添加
我有一个使用 IdentityModel 中的 TokenClient 的新 MVC 项目 var tokenClient = new TokenClient(tokenUrl, clientId,
我正在尝试通过实现 UserNamePasswordValidator 来提供用户身份验证。我添加了 Microsoft.IdentityModel 和 System.IdentityModel.To
我正在尝试通过自定义类库使用 IdentityModel.dll。 我有一个 Web 服务(将作为 WSP 部署在 SharePoint 中),我想在其中使用 IdentityModel.Oidccl
如 leastprivilege 中所述,有两种方法可以使用 Thinktecture.IdentityModel 设置声明授权检查。一种是设置过滤器。另一种是为要检查的 Action 添加属性。 我
我有一个基于 TcpClient/TcpListener 和 SslStream 的简单客户端-服务器应用程序。客户端可以使用 X509Certificate 或在建立 SslStream 后发送用户
我最近被迫将我的 System.IdentityModel.Tokens.Jwt NuGet 包更新到 5.1.4,因为另一个 NuGet 包。更改后的大部分代码似乎很容易解决,但现在 Configu
我正在尝试使用 JWT token 验证用户。我在下面使用的代码在控制台应用程序中工作得很好。但是当我想在我的 Azure 函数中应用它时,它给我错误: 无法加载文件或程序集 Microsoft.Id
我是一名优秀的程序员,十分优秀!