2012-02-15 57 views
2

如何配置dotnetopenauth不使用安全通道?以下是我的網絡配置設置。當我嘗試使用不安全的endponts創建WebServerClient時,我收到一條消息,要求使用HTTPS。我錯過了什麼嗎?似乎dotnetopenauth沒有讀取配置值。DotNetOpenAuth 4不讀配置值

<configSections> 
    <section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true" /> 
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false" /> 
    </configSections> 

    <dotNetOpenAuth> 
    <!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. --> 
    <!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ --> 
    <!-- You may also refer to README.Bin.html for instructions on enabling Intellisense for this section. --> 
    <openid> 
     <relyingParty> 
     <security requireSsl="false"> 
      <!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. --> 
      <trustedProviders rejectAssertionsFromUntrustedProviders="false"> 
      <add endpoint="https://www.google.com/accounts/o8/ud" /> 
      <add endpoint="http://localhost/oauth" /> 
      </trustedProviders> 
     </security> 
     <behaviors> 
      <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible 
       with OPs that use Attribute Exchange (in various formats). --> 
      <add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" /> 
      <add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" /> 
     </behaviors> 
     </relyingParty> 
    </openid> 
    <!-- Relaxing SSL requirements is useful for simple samples, but NOT a good idea in production. --> 
    <messaging relaxSslRequirements="true"> 
     <untrustedWebRequest> 
     <whitelistHosts> 
      <!-- since this is a sample, and will often be used with localhost --> 
      <add name="localhost" /> 
     </whitelistHosts> 
     </untrustedWebRequest> 
    </messaging> 
    <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. --> 
    <reporting enabled="false" /> 
    </dotNetOpenAuth> 
+0

請將您的web.config文件中的元素添加到您的代碼片段中。 – 2012-02-16 15:54:00

+0

我添加了該部分。我正在使用測試版4.0.0.12030。我下降到4.0.0.11165,並能夠得到它的工作。 – Phil 2012-02-16 17:54:01

回答

2

由於您的<configSections>已過時,因此它不適用於較新版本的DNOA。您可以看看DNOA 4.0 here的外觀。

<configSections> 
    <sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core"> 
     <section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" /> 
     <section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" /> 
     <section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" /> 
     <section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" /> 
    </sectionGroup> 
</configSections>