forms authentication + AzMan in ASP.Net 2...

From: Jéjé (willgart_at_BBBhotmailAAA.com)
Date: 09/24/05


Date: Sat, 24 Sep 2005 10:56:33 -0400

Hi,

I try to use the AzMan to manage my roles & operations.
I'm using a form based authentication in an ASP.Net 2 application and the
SQL Server provider to store my users accounts into the database.

But I can manage roles for users with a login name which exists in the
Active Directory where my development server is.
Any time I try to play with a user account not reated in the AD, then I
receive some errors.
For example, when I try to add a role to a user, I receive this error:
Could not add the user to the role: Exception has been thrown by the target
of an invocation.

but the same commands works fine when I access the account which exists in
the AD.

my web.config:
<connectionStrings>
  <remove name="LocalSqlServer" />

  <add name="LocalSqlServer" connectionString="Data Source=<server>;Initial
Catalog=<database>;Persist Security Info=True;User ID=sa;Password="
   providerName="System.Data.SqlClient" />
  <add name="LocalPolicyStore"
     connectionString="msxml://c:/folder/azmanstore.xml" />
 </connectionStrings>

<membership>

<providers>

<remove name="AspNetSqlMembershipProvider"/>

<add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"

enablePasswordReset="true" requiresQuestionAndAnswer="true"

applicationName="/" requiresUniqueEmail="false"

passwordFormat="Hashed" maxInvalidPasswordAttempts="5"

passwordAttemptWindow="10" passwordStrengthRegularExpression=""

minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0"

name="AspNetSqlMembershipProvider"

type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

</providers>

</membership>

<roleManager

enabled="true"

cacheRolesInCookie="false"

defaultProvider="RoleManagerAzManProvider"

cookieName=".ASPXROLES"

cookiePath="/"

cookieTimeout="30"

cookieRequireSSL="false"

cookieSlidingExpiration="true"

createPersistentCookie="false"

cookieProtection="All">

<providers>

<add name="RoleManagerAzManProvider"

type="System.Web.Security.AuthorizationStoreRoleProvider, System.Web,
Version=2.0.0.0,

Culture=neutral, publicKeyToken=b03f5f7f11d50a3a"

connectionStringName="LocalPolicyStore"

applicationName="<application name>"/>

</providers>

</roleManager>

Thanks for your help!!!

jerome.



Relevant Pages

  • Re: Enterprise Library - DataAccessApplicationBlock - MySql/DB2
    ... The fact that you set parameters differently for different providers isn't ... Oracle or Microsoft told me "We don't like the way you did that", ... ISDATE doesn't produce the same results in both Sql Server ... and Oracle both have a ton of specific features that others don't have. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Can you use the OleDb classes for SQL Server?
    ... William Vaughn ... Hitchhiker's Guide to Visual Studio and SQL Server ... I didn't mean using the same stored procedures for different RDBMSes. ... William it's better to use abstraction in the code such as providers and i ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ado vs oledb
    ... providers including SqlClient, ... like Odbc and OleDb which require ODBC drivers or OLEDB data providers to ... Hitchhiker's Guide to Visual Studio and SQL Server ... Between now and Nov. 6th 2006 you can sign up for a substantial discount. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection to SQL Server on Vista
    ... The OP is using SQL Server 2000 not 2005. ... build versions and are now called "Data Access Components". ... In addition just telling someone to change providers with a working app is ... own providers so we will have SNAC, DAC (er, MDAC), and "ONAC". ...
    (microsoft.public.vb.database.ado)
  • Re: Error using OPENROWSET
    ... SQL Server does not allow ad hoc distributed queries using ... OPENROWSET and OPENDATASOURCE against providers other than the SQL Native ... Client OLE DB Provider. ... Check the "Ad Hoc Distributed Queries Option" topic in Books OnLine. ...
    (microsoft.public.sqlserver.datamining)