1

错误消息 401.2.:未经授权:由于服务器配置,登录失败。根据您提供的凭据和 Web 服务器上启用的身份验证方法,验证您是否有权查看此目录或页面。请与 Web 服务器的管理员联系以获得更多帮助。\

将网站属性更改为项目 URL:localhost/StsClient 时出现上述错误。但是,对于设置为 localhost:21817/ 的 IIS express,它工作正常

请问有什么帮助吗?为什么我不能在本地 IIS 中拥有 STS 客户端?还是我错过了什么?下面是客户端配置

<system.webServer>
    <modules>
      <add name="WSFederationAuthenticationModule" type="System.IdentityModel.Services.WSFederationAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
      <add name="SessionAuthenticationModule" type="System.IdentityModel.Services.SessionAuthenticationModule, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler" />
    </modules>
  </system.webServer>
  <system.identityModel>
    <identityConfiguration>
      <audienceUris>
        <add value="http://localhost/StsClient" />
      </audienceUris>
      <securityTokenHandlers>
        <add type="System.IdentityModel.Services.Tokens.MachineKeySessionSecurityTokenHandler, System.IdentityModel.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <remove type="System.IdentityModel.Tokens.SessionSecurityTokenHandler, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </securityTokenHandlers>
      <certificateValidation certificateValidationMode="None" />
      <issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry">
        <authority name="DeveloperSts">
          <keys>
            <add thumbprint="#################################" />
          </keys>
          <validIssuers>
            <add name="DeveloperSts" />
          </validIssuers>
        </authority>
      </issuerNameRegistry>
    </identityConfiguration>
  </system.identityModel>
  <system.identityModel.services>
    <federationConfiguration>
      <cookieHandler requireSsl="false" />
      <!--<wsFederation passiveRedirectEnabled="true" 
      <wsFederation passiveRedirectEnabled="true" issuer="http://localhost/StsService/Security/Authorize" realm="http://localhost/StsClient" requireHttps="false" />
    </federationConfiguration>
  </system.identityModel.services> 
4

1 回答 1

0

好的..这很有趣..当我使用 IE11 显示它时,它给出了另一个错误:

“加密操作期间发生错误。”</p>

然后我打开了在 IIS 中启用的 windows 身份验证,现在它工作正常..

到目前为止,客户端站点仍然无法通过 Chrome 加载,不知道为什么..

于 2014-05-09T06:00:17.600 回答