Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How to use multiple providers in 1 web.config?

  Asked By: Tarak    Date: Dec 01    Category: Sharepoint    Views: 1271

I am having one ASPNetsql provider and want to implement another ADAM
Provider. Now whenever I try to add another provider in central admin
web.config, I get error "Sections must only appear once per config

It seems using asp.net 2.0 ot higher I can use only 1 provider in
web.config, how can I use both the provider in 1 web.config. Here is
snippet of my web.config, please advise how can I manage this
situation as I am using FBA for both the providers

<!-- ADAM Membership Provider-->
<membership defaultProvider="ADAMMembership">
<add name="ADAMMembership"
Microsoft.Office.Server, Version=, Culture=neutral,
PublicKeyToken=71E9BCE111E9429C" server="HOServer" port="389"
useSSL="false" userDNAttribute="distinguishedName"
userNameAttribute="cn" userContainer="CN=Users,OU=ADAMHO,O=ADAM,C=US"
userObjectClass="user" userFilter="(ObjectClass=user)"
scope="Subtree" otherRequiredUserAttributes="sn,givenname,cn" />
<!-- SQL Membership Provider-->
<membership defaultProvider="FBA_AspNetSqlMembershipProvider">
<add name="FBA_AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
enablePasswordRetrieval="false" enablePasswordReset="true"
requiresQuestionAndAnswer="false" applicationName="/"
requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />



1 Answer Found

Answer #1    Answered By: Zoe Cotton     Answered On: Dec 01

Each Web.config file only supports one Membership provider. This leaves you
with two options.

1) Extend the existing web  application to a different zone and add  the
second provider  there. Users can access either provider based on the URL they
use to login. The content is the same.

2) Write a custom membership provider that looks for users in both SQL and
ADAM. Use this combined provider as your membership provider.

Didn't find what you were looking for? Find more on How to use multiple providers in 1 web.config? Or get search suggestion and latest updates.