ユーザーがASP.NETフォーム認証を使用してログインするWebアプリケーションがあります。 WebアプリケーションにはSilverlightアプリケーションがあります。 Silverlightアプリケーションは、同じサーバー上でWCF Webサービスを呼び出します。SSL(ASP.NETフォーム認証)に切り替えるとWCFでアクセスが拒否される
[PrincipalPermission(SecurityAction.Demand, Authenticated = true)]
私はIIS上で展開し、HTTPを使用する場合は、このすべての作品:WCFサービスは、匿名アクセスがので、各サービス機能を持つことはできません。
しかし、私はSSLを使いたいので、これを設定しようとしています。 httpsバインディングでIISにWebサイトを作成しました。 httpsとASP.NETフォーム認証を使用してサイトにログインできます。私はSilverlightアプリケーションをダウンロードすることができますが、SilverlightがWCF Webサービス(同じサーバー上で、/ Services)を呼び出そうとすると、今アクセスが拒否されます(httpを使用していたときにこれを取得しませんでした)。
ASPXページは、.SVC-ファイルは/サービスの下にある、ルートに 私のweb.configファイルスタイル/下/ IMGとの.css下の画像です:
<location path="Img">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Styles">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Services">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<authentication mode="Forms">
<forms name=".COOKIEDEMO"
loginUrl="~/Login.aspx"
protection="All"
timeout="30"
path="/"/>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<compilation strict="true" debug="true" explicit="true" targetFramework="4.0" />
<!-- Customizing the membership provider-->
<membership defaultProvider="SaverpMesProvider" userIsOnlineTimeWindow="30">
<providers>
<add name="SaverpMesProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" applicationName="SaverpMES" />
</providers>
</membership>
<roleManager enabled="true" defaultProvider="SaverpMesRoleProvider">
<providers>
<add name="SaverpMesRoleProvider"
connectionStringName="LocalSqlServer"
applicationName="SaverpMes"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
<profile inherits="SaverpMes.Web.MesProfile" defaultProvider="SaverpMesProfileProvider">
<providers>
<add name="SaverpMesProfileProvider"
connectionStringName="LocalSqlServer"
applicationName="SaverpMes"
type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</profile>
</system.web>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinaryBinding">
<binaryMessageEncoding/>
<httpsTransport/>
</binding>
</customBinding>
</bindings>
<extensions>
<behaviorExtensions>
<add name="silverlightFaultExtension" type="SaverpMes.Web.Wcf.SilverlightFaultBehavior, SaverpMes.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<add name="wcfFaultExtension" type="SaverpMes.Web.Wcf.WcfFaultBehaviorExtensionElement, SaverpMes.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</behaviorExtensions>
</extensions>
<services>
<service behaviorConfiguration="ServiceBehavior" name="Product.FrontEnd.WcfService.ProductService">
<endpoint address="" behaviorConfiguration="SilverlightFaultsBehavior"
binding="customBinding" bindingConfiguration="CustomBinaryBinding"
name="ProductServiceEndpoint" contract="Product.FrontEnd.Contract.IProductService" />
</service>
<service behaviorConfiguration="ServiceBehavior" name="Product.FrontEnd.WcfService.PublicProductService">
<endpoint address="" behaviorConfiguration="SilverlightFaultsBehavior"
binding="customBinding" bindingConfiguration="CustomBinaryBinding"
name="PublicProductServiceEndpoint" contract="Product.SG.IPublicProductService" />
</service>
<service behaviorConfiguration="ServiceBehavior" name="Identification.FrontEnd.WcfService.FrontEndService">
<endpoint address="" behaviorConfiguration="SilverlightFaultsBehavior"
binding="customBinding" bindingConfiguration="CustomBinaryBinding"
name="IdentificationServcieEndpoint" contract="Identification.FrontEnd.Contract.IFrontEndService" />
</service>
<service behaviorConfiguration="ServiceBehavior" name="Common.WcfService.CommonService">
<endpoint address="" behaviorConfiguration="SilverlightFaultsBehavior"
binding="customBinding" bindingConfiguration="CustomBinaryBinding"
name="CommonServiceEndpoint" contract="Common.Contract.ICommonService" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="SilverlightFaultsBehavior">
<silverlightFaultExtension/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<wcfFaultExtension/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true"/>
</system.serviceModel>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
基本的に私は、Webで変更したものhttp Webサイトとhttpsの間の.configファイルは、customBindingではhttpsTransport、serviceMetadataではhttpsGetEnabledです。
大変ありがとうございました!