Windows Azure RDP 上的基本身份验证问题

发布于 2024-12-05 07:21:03 字数 1616 浏览 0 评论 0原文

我在 Azure 平台上托管了一项 WCF 服务,并在 web.config 中启用了基本身份验证,如下所示

<system.serviceModel>
<services>
  <service behaviorConfiguration="SimpleServiceBehavior" name="RestService.RestServiceImpl">
    <endpoint address="http://localhost/RestWCFDemo/RestServiceImpl.svc" binding="webHttpBinding" bindingConfiguration="secureBasic" contract="RestService.IRestServiceImpl" behaviorConfiguration="HttpEnableBehavior" />
  </service>
</services>
<bindings>
  <webHttpBinding>
    <binding name="secureBasic">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Basic"></transport>

      </security>
    </binding>
  </webHttpBinding>
</bindings>
<behaviors>
  <endpointBehaviors>
    <behavior name="HttpEnableBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="SimpleServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />

在 Azure 上它没有运行。在本地,我已在 IIS 上托管此服务并启用基本身份验证,然后当我从 URL 访问它时,它才会要求提供凭据,同样,我已禁用除基本身份验证之外的所有身份验证方法,但我仍然无法运行此服务,这可能是什么问题?有人能提出解决方案吗?

I have hosted one WCF Service on the Azure platform and in web.config enabled basic authentication as per below

<system.serviceModel>
<services>
  <service behaviorConfiguration="SimpleServiceBehavior" name="RestService.RestServiceImpl">
    <endpoint address="http://localhost/RestWCFDemo/RestServiceImpl.svc" binding="webHttpBinding" bindingConfiguration="secureBasic" contract="RestService.IRestServiceImpl" behaviorConfiguration="HttpEnableBehavior" />
  </service>
</services>
<bindings>
  <webHttpBinding>
    <binding name="secureBasic">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Basic"></transport>

      </security>
    </binding>
  </webHttpBinding>
</bindings>
<behaviors>
  <endpointBehaviors>
    <behavior name="HttpEnableBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="SimpleServiceBehavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="false" />

On Azure it is not running. In local I have hosted this service on IIS and Enabled basic authentication only then it will ask for credentials when I will access it from URL, same way I have disabled all authentication methods except basic still I can't run this service what could be the problem? Can anyone suggest a solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木有鱼丸 2024-12-12 07:21:03

您可以尝试将 proxyCredentialType 添加到您的传输中:

<transport clientCredentialType="Basic" proxyCredentialType="Basic"/>

我还会设置 includeExceptionDetailInFaults="true" ,这样如果不起作用,您可以更好地看到问题。

You can try adding a a proxyCredentialType to your transport:

<transport clientCredentialType="Basic" proxyCredentialType="Basic"/>

I would also set includeExceptionDetailInFaults="true" so you can see the problem better if that doesn't work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文