1
認証ルーチンに別のWCF AuthenticationServiceを使用します。メソッド:ValidateUser、Login trueを返すので、すべて正常に動作しているようですが、Login()メソッドを消費した後にIsLoggedIn()を呼び出すとfalseを返します。WCF AuthenticationService.IsLoggedInの問題
のAuthService設定:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<clear />
<add name="LocalMySqlServer" connectionString="server=192.168.0.7;Database=clients; uid=clients;pwd=fetisova;persist security info=True;CharSet=utf8; Use Procedure Bodies =false;" providerName="MySql.Data.MySqlClient" />
</connectionStrings>
<system.web>
<machineKey validation="SHA1" />
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms" >
<forms cookieless="UseCookies" />
</authentication>
<membership defaultProvider="MySQLMembershipProvider">
<providers>
<clear />
<add name="MySQLMembershipProvider"
type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
connectionStringName="LocalMySqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="Clients"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="500"
minRequiredPasswordLength="3"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
<roleManager defaultProvider="MySQLRoleProvider" enabled="true">
<providers>
<clear />
<add name="MySQLRoleProvider"
connectionStringName="LocalMySqlServer"
applicationName="Clients"
type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.1.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</providers>
</roleManager>
</system.web>
<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true"/>
</webServices>
</scripting>
</system.web.extensions>
<system.serviceModel>
<services>
<service name="System.Web.ApplicationServices.AuthenticationService"
behaviorConfiguration="AuthenticationServiceTypeBehaviors">
<endpoint contract=
"System.Web.ApplicationServices.AuthenticationService"
binding="basicHttpBinding"
bindingConfiguration="userHttps"
bindingNamespace="http://asp.net/ApplicationServices/v200"/>
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="userHttps">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="AuthenticationServiceTypeBehaviors">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug
httpHelpPageEnabled="true"
includeExceptionDetailInFaults="true"
/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment
aspNetCompatibilityEnabled="true"/>
だから何が悪いですの?あなたは私を助けることができますか?
代わりにUser.Identity.IsAuthenticatedを使用しないでください。 – Wodzu
これは誤りです。私は私のASPnetアプリケーション内のユーザーを認証していません。私は別のwcfサービス(認証サービス)でそれを行う。 –