4

私はWebサービスを初めて使用し、次の問題が発生します。IIS7.5およびWindows2008R2でWindows認証モードで実行されているWCFサービスがあります。IISマシンから直接呼び出すとうまく機能します。しかし、ローカルコンピュータからサービスを呼び出そうとすると、次のエラーが発生します。401-不正:資格情報が無効なため、アクセスが拒否されました。

サービスはローカルコンピューターで数日間動作していましたが、突然停止しました(わかりませんが、一部の構成が変更された可能性があります)。

IExplorerから直接サービスに電話します。http://serveriis/ssopension/service.svc

web.config:

 <?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
    <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
      <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
        <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
          <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
          <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
            <KeyName>Rsa Key</KeyName>
          </KeyInfo>
          <CipherData>
            <CipherValue>O8jBoF9YUW3sZtSN+L/Xxhzss=</CipherValue>
          </CipherData>
        </EncryptedKey>
      </KeyInfo>
      <CipherData>
        <CipherValue>C+EeTszivHho8Ujk2oIQ==</CipherValue>
      </CipherData>
    </EncryptedData>
  </connectionStrings>


<system.web>
    <compilation targetFramework="4.0" />

    <authentication mode="Windows" />

    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
  </system.web>

  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpEndpointBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

    <services>
      <service behaviorConfiguration="SSO_Pension.ServiceBehavior" name="SSO_Pension.Service">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" name="BasicHttpEndpoint" contract="SSO_Pension.IService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>

      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="SSO_Pension.ServiceBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    </system.serviceModel>


    <system.webServer>
        <defaultDocument>
            <files>
                <add value="Service.svc" />
            </files>
        </defaultDocument>
    </system.webServer>

</configuration>
4

2 に答える 2

4

http://social.technet.microsoft.com/Forums/en-US/winserversecurity/thread/c9239a89-fbee-4adc-b72f-7a6a9648331f/で解決策を見つけました

これが助けになる人には、これが私の命を救った...

IIS 7は、401を取得した理由を理解するのが困難でした-無許可:無効な資格情報のためにアクセスが拒否されました...これを行うまで...

1.)iisを開き、401の原因となっているWebサイトを選択します

2.)「IIS」ヘッダーの下にある「Authentication」プロパティを開きます

3。)[Windows認証]アイテムをクリックし、[プロバイダー]をクリックします

4.)私にとっての問題は、NegotiateがNTLMを上回っていたことでした。舞台裏で何らかの握手が行われていると思いますが、実際に認証されることはありませんでした。NTLMを一番上の場所に移動し、BAMで修正しました。

于 2012-07-11T07:06:39.707 に答える
0

ありがとう!

私はこれらの2つの記事を含めて、これをどこでも探してきました:

http://blogs.msdn.com/b/distributedservices/archive/2009/11/10/wcf-calling-wcf-service-hosted-in-iis-on-the-same-machine-as-client-throws- an-authentication-error.aspx

http://support.microsoft.com/default.aspx?scid=kb;EN-US;926642

これで私の問題は解決しました。

于 2012-09-14T07:26:08.197 に答える