【问题标题】:DotNetOpenAuth and ResourceServer service https configurationDotNetOpenAuth 和 ResourceServer 服务 https 配置
【发布时间】:2014-03-20 15:48:59
【问题描述】:

我正在尝试将 DotNetOpenAuth 的 DataApi.svc 服务配置为使用 AJAX 通过 https 调用我的资源。

我可以调用服务并点击后面的代码,但 OperationContext.Current.ServiceSecurityContext 将不会通过身份验证

在 IIS 中,我将“匿名身份验证”设置为“true”。

在 Fiddler 中,我可以看到标头已发送: 授权:承载gAAAAMcRmG5vw3LykShq7cNOEGUACBiNtlVGxGYdSVfkkXjR-[截断]

界面是这样装饰的:

[服务合同] 公共接口 IDataApi {

[OperationContract, WebGet(UriTemplate = "/email", ResponseFormat = WebMessageFormat.Json)] 字符串 GetEmail();

这是我的配置:

<bindings>
  <wsHttpBinding>
    <binding>
      <security mode="Transport">
        <transport clientCredentialType="None"/>
      </security>
    </binding>
  </wsHttpBinding>
  <webHttpBinding>
    <binding>
      <security mode="Transport">
        <transport clientCredentialType="None"/>
      </security>
    </binding>
  </webHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="DataApiBehavior">
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceMetadata httpsGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="DataApiWebBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
</behaviors>

<services>
  <service behaviorConfiguration="DataApiBehavior" name="OAuthResourceServer.DataApi">
    <endpoint address="" binding="wsHttpBinding" contract="OAuthResourceServer.Code.IDataApi" />
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    <endpoint address="web" binding="webHttpBinding" contract="OAuthResourceServer.Code.IDataApi" behaviorConfiguration="DataApiWebBehavior">
    </endpoint>
  </service>
</services>

你知道什么是错的吗?

谢谢!

【问题讨论】:

    标签: wcf ssl dotnetopenauth


    【解决方案1】:

    我错过了

     <serviceAuthorizationserviceAuthorizationManagerType="OAuthResourceServer.Code.OAuthAuthorizationManager, OAuthResourceServer" principalPermissionMode="Custom" />
    

    在服务行为中!解决了:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-14
      • 2020-03-28
      • 1970-01-01
      • 2014-09-23
      相关资源
      最近更新 更多