Hi,
I'm trying to use asp.net Membership in my site. I use forms
authentication,and running anonymous access in the IIS.
without the membership everything works fine when login to DB,but when i'm trying to do something like: User.IsInRole('xxx')
i'm getting: Login failed for user 'Domain\MachineName' although this is NOT the user the application should run with.
If I write explicitly the right user name in the connection string - it's still doesn't work.
this is the web.config part:
<connectionStrings>
<clear/>
<add name="MyConnectionString" connectionString="Server=ServerName;Database=MydbName;
Trusted_Connection=Yes;" />
</connectionStrings>
<system.web>
<identity impersonate="true"/>
<membership defaultProvider="SqlMembershipProvider">
<providers>
<clear/>
<add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="MyConnectionString"
enablePasswordRetrieval="false"
applicationName="App"
passwordFormat="Hashed" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" applicationName="App"
connectionStringName="MyConnectionString"/>
</providers>
</roleManager>
any ideas?
Thank you!
I'm trying to use asp.net Membership in my site. I use forms
authentication,and running anonymous access in the IIS.
without the membership everything works fine when login to DB,but when i'm trying to do something like: User.IsInRole('xxx')
i'm getting: Login failed for user 'Domain\MachineName' although this is NOT the user the application should run with.
If I write explicitly the right user name in the connection string - it's still doesn't work.
this is the web.config part:
<connectionStrings>
<clear/>
<add name="MyConnectionString" connectionString="Server=ServerName;Database=MydbName;
Trusted_Connection=Yes;" />
</connectionStrings>
<system.web>
<identity impersonate="true"/>
<membership defaultProvider="SqlMembershipProvider">
<providers>
<clear/>
<add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="MyConnectionString"
enablePasswordRetrieval="false"
applicationName="App"
passwordFormat="Hashed" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Security.SqlRoleProvider" applicationName="App"
connectionStringName="MyConnectionString"/>
</providers>
</roleManager>
any ideas?
Thank you!