SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Defining multiple authentication providers to a single MOSS 2007 web application

email

I wrote this some time ago but never got around to blogging it.  Much of the content is similar to information already out there but I think there is enough that is different to still warrant a quick blog... In particular I'd like to thank ANdrew Connel for his excellent post on th esame subject, much of which is replicated here.  Between Andrew Connels post and others I've picked out all the best bits and added steps in where I felt a stupid person (me) might go wrong!

The Small to Medium Business (SMB) market is large. Microsoft Office SharePoint Server 2007 (MOSS 2007) is taking a foothold. SMBs, especially those that make use of the old Microsoft Content Management Server (CMS) product which is now encompassed in MOSS 2007 and not available as a separate product, will increasing be looking to MOSS 2007 as a natural progression. These smaller businesses are looking to deploy a single MOSS 2007 server farm to provide access:

· internally, as an intranet replacement

· externally with partners, as an extranet

· and increasingly as their public facing internet site.

To an IT company used to working with some of the largest businesses in the world this may seem like a bad idea – employees, partners and the public all using the same server, all accessing the same data. Security wise too, although users only have access to what their credentials allow and content is protected by Access Control Lists (ACLs) there are obvious implications for a breech in security. However, for SMBs this may be deemed an acceptable situation, especially when considered alongside the financial savings of reduced licenses (multiple products superseded by MOSS 2007 new functionality), reduced servers...

Of course this is a hypothetical scenario and there may be many more legitimate reasons why a customer may want multiple access methods for a single MOSS 2007 implementation.

So, how would we go about setting up MOSS 2007 to allow this? Let’s take our hypothetical case and configure a solution. Firstly let’s look at intranet users and make the assumption that we are working with a Microsoft based architecture using Active Directory (AD) as their directory services model. Next we need partners to be able to access the MOSS 2007 server but let’s assume that the client has a great many partners and doesn’t want to allocate them each an AD account on their domain, even if that account were locked down. Architecturally, the most obvious solution is Forms Based Authentication (FBA) using a role and membership provider to allocate and authenticate credentials. And finally let’s supply internet users with anonymous access to the server. Of course, we will have planned the security groups within which the access accorded to each of our types of user (intranet, extranet, internet) is restricted and have strict governance of how and when access is granted between these groups. So an internet user may have access to published pages but not to the collaborative working areas of the site. Extranet users may only have access to dedicated partner sites in which they have been explicitly granted access and any general partner sites. Intranet users will have access to general staff areas an any site explicitly granted to them.

So we have 3 authentication methods:

1. NTLM through AD – intranet

2. Forms Based Authentication – extranet

3. Anonymous access - internet

To demonstrate this scenario I have used a simple single server installation of MOSS 2007 on a Virtual PC (VPC) image. The steps that follow describe the exact settings you will need to prove this concept. You would obviously not use SQL Express in a production environment, however there is little consideration in using it for test purposes. However for the purposes of illustration the following achieves our goal:

We need a data store in which to hold our membership profiles and roles:

1) Install SQL Express

a. Create a DB called: Users_and_Roles

b. Use LocalSystem account and mixed mode authentication

c. Accept default throughout the rest of the install

Now that we’ve created the database we will need to create a membership and role provider. Fortunately Visual Studio will do this for us. This is unlikely to be extensive enough for a live implementation but is perfectly suitable to demonstrate this process:

2) Create a new Web site project in Visual Studio 2005 to add users

a. Open Visual Studio 2005 and select File -> New -> Web Site

b. Select ASP.NET Web Site

c. Right click the project in “solution explorer”

d. Add a new item -> choose Web Config File

i. Alter the configuration tag to represent:

<connectionStrings>

<add name="ConnectionString"

connectionString="server=HP_SERVER

;database=Users_and_Roles;Integrated Security=SSPI;"

providerName="System.Data.SqlClient"/>

</connectionStrings>

Figure 1: Connection String

ii. And within the system.web tag add the following

<!-- membership provider -->

<membership defaultProvider="AcAspNetSqlMembershipProvider">

<providers>

<add name="AcAspNetSqlMembershipProvider"

type="System.Web.Security.SqlMembershipProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a"

connectionStringName="ConnectionString"

enablePasswordRetrieval="false"

enablePasswordReset="true"

requiresQuestionAndAnswer="false"

applicationName="/"

requiresUniqueEmail="false"

passwordFormat="Hashed"

maxInvalidPasswordAttempts="5"

minRequiredPasswordLength="1"

minRequiredNonalphanumericCharacters="0"

passwordAttemptWindow="10"

passwordStrengthRegularExpression=""/>

</providers>

</membership>

<!-- role provider -->

<roleManager enabled="true"

defaultProvider="AcAspNetSqlRoleProvider">

<providers>

<add name="AcAspNetSqlRoleProvider"

type="System.Web.Security.SqlRoleProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a"

connectionStringName="ConnectionString"

applicationName="/" />

</providers>

</roleManager>

Figure 2: Role and Membership Providers

e. Go to the website menu and select configure asp.net

f. Click security, choose authentication type -> “from the internet”

g. Create a users and a roles

h. Add users to roles

That’s it for the profile store! Now what we need to do is create the MOSS 2007 sites that we’ll use to prove authentication against. Using host header allows us to specify multiple web applications pointing to the same content. Each web application will have a unique identifier and will be associated with a security zone (internet, extranet, intranet...). The following steps will create a single MOSS 2007 site with two entry points – connect and connectXtra, the intranet and extranet respectively:

3) In Central Admin:

a. Create the intranet site...Application Management -> Create or Extend Web Application > Create

i. Set the Description

ii. Set the Port [80]

iii. Set the Host Header to [connect ]

iv. Pick NTLM as the Authentication Provider

v. Specify Anonymous Access to No

b. Click the hyperlink, Create Site Collection

c. Enter values as appropriate, for the test I used the publishing template

4) Back in Central Admin

a. Create the extranet site...Application Management -> Create or Extend Web Application > Extend

i. Set the Description

ii. Set the Port [80]

iii. Set the Host Header to [connectXtra]

iv. Pick NTLM as the Authentication Provider (we’ll change this later)

v. Specify Anonymous Access to No (and this!)

vi. Set the Load Balanced URL Zone to [connectXtra]

vii. Set the zone to extranet

b. Go back to Application Management and choose Authentication providers

c. Click on the Windows authentication provider link and

i. Make sure anonymous access is ticked

ii. Change the authentication to Forms

iii. Add the following as the membership provider: AcAspNetSqlMembershipProvider

iv. Add the following as the role provider: AcAspNetSqlRoleProvider

v. Save

vi. Note: Disabling client integration will remove features which launch client applications. Some authentication mechanisms (such as Forms) don't work well with client applications. In this configuration, users will have to work on documents locally and upload their changes.

In your test environment you may not have access to the DNS server but in simple terms, to make the host headers work you will need to tell your environment how to resolve the host header names (connect and connectXtra)

5) Add the host headers to DNS / hosts file!

a. For DNS (if you have access) add resolvers for connect and connectXtra. They should both resolve to the IP address of your MOSS 2007 server.

b. If you don’t have access to the DNS server edit your hosts file to resolve the addresses.

i. Open the hosts file in notepad, this exists in the [C:\Windows\System32\drivers\etc] directory, assuming Windows is your OS directory.

ii. Make the changes to reflect the following

[MOSS Server IP Address] connect

[MOSS Server IP Address] connectXtra

We would now be able to access the site via either of the URLs http://connect or http://connectXtra but before we do, we should configure the portal to understand the membership and role provider we specified:

6) Modify the web.config files:

a. Open the web.config for the intranet site

i. You will find the web.config file in the c:\inetpub\wwwroot unless you have configured a different home directory location. The parent directory name should be similar to [80_connect]

b. Add the <connectionstrings> above immediately after the </SharePoint> tag

c. Add the <membership> and <roleManager> tags immediately after the <system.web> tag

d. Open the web.config for the extranet site

i. The parent directory name should be similar to [80_connectXtra]

e. Repeat steps 6b & 6c

f. Open the web.config for central admin

i. Open central admin and note the port number, the parent directory name should be similar to [port_number]

g. Repeat steps 6b & 6c but replace AcAspNetSqlRoleProvider with AspNetWindowsTokenRoleProvider

Now we’re ready to test our installation:

7) On the top level web site [connect]:

a. Add the user created in step 2g to the site

8) On the extranet web site [connectXtra]

a. Accessing the URL will redirect you to the login page

b. Log in

c. Verify access to the site

9) Adding anonymous access

a. Make the FBA user as admin

i. In central admin -> application management

ii. Select Policy for web application

iii. Select Add Users and add the user created in 2g with full control

b. Load the portal page [connectXtra] and login

c. The portal sites’ first page [connect] prompts you to enable anonymous access

i. Click the link

ii. For simplicity, select ‘entire web site’

d. You can now access the home page as an anonymous user (internet user)

10) You may now wish to experiment with creating sites and adding custom permissions, for example:

a. Create a site that only logged in NTLM authenticated or FBA users have access

b. Create a site that only NTLM authenticated users have access

c. Etc!

That’s it we now have 3 access mechanisms to the same MOSS 2007 portal.

· http://connect requiring NTLM challenge response credentials

· http://connectXtra either through anonymous access or by logging using FBA

We may wish to extend this further to give anonymous users an alternative URL via which to access the portal by extending the site again but in the internet zone this time. However this is a mute point and simple to implement in practice now that we have done the hard work!


Posted 07-04-2007 2:52 PM by Andrew Noon

Comments

steven fowler wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 07-06-2007 2:42 PM

There is also the consideration for SSO for your internet user. The implementation I had required the used of forms authentication. Good post.

Mike Walsh's WSS and more wrote WSS FAQ additions and changes LXII - 2nd - 8th July 2007
on 07-08-2007 3:02 AM
Eric Fenicker wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 07-13-2007 12:37 PM

How does Microsoft Licensing play into this?  As far as I can tell, all the legal jargon says you cannot get away with a single farm hosting all three zones, i.e. you cannot secure a workspace to prevent an anonymous use from seeing.  Technically you can do it... legally you cannot.  Internet must be on a seperate FARM.

Andrew Noon wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 07-13-2007 1:22 PM

Yep.  Hence the seperate product - MOSS for Internet Sites, priced accordingly!

29 Links Today (2007-07-16) wrote 29 Links Today (2007-07-16)
on 07-16-2007 10:29 AM

Pingback from  29 Links Today (2007-07-16)

gav wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 08-06-2007 7:59 PM

Im not 100% up to speed on this membership/roles. Is it possible to use a Active Directory Provider and import AD groups for permissions instead of adding users to sharepoint groups? in the past I've used intergrated Auth with NT groups, can I use the existing groups but via the AD membership provider?

DEvdutta wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 08-25-2007 3:57 PM

I want to show a login form to my intranet users(employee) when they access the portal from internet. The authentication will be done against the same active directory. Could you suggest me how to implement it?

Ramesh Kumar wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 08-28-2007 5:56 AM

Hi ,

Can you please tell me how to find the ldap connection string for my active directory.

I am new to active directory concepts . So plesae explain it in detail.

Thanks in advance.

SharePoint From Scratch wrote Authentication Providers
on 10-17-2007 3:32 PM

So, now the customer wants to be able to port his Oracle data into his SharePoint sites and that will

Vlad Nemet wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 03-02-2008 6:36 AM

Hi,

What happens when company users connect throuh RSA SecureId? Is there any additional authentication needs to be added on IIS?

Andrew Noon wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 03-04-2008 3:27 AM

Got to be honest and admit I've never had to do it (yet!)

oscar fuster wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 04-30-2008 2:13 PM

Have you taken a look at Epok’s extranet server for SharePoint 2007.  Check out the demo in the link below:

www.epok.net/.../epok_edition_preso.html

If you are interested I can arrange for a full demo.

jack wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 05-20-2008 6:13 PM

Funny, this looks exaclty like Andrew's post, right down to the AC in front of everything.

www.andrewconnell.com/.../HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx

Andrew Noon wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 05-29-2008 4:11 PM

Jack,  you couldn't be more right!  There will be many parts of this blog that look a lot like Andrew's post.  Like you when I wanted to pick this up I looked at blogs and other resources, I thought there were some holes in other blog entries and I've tried to fill them here.

I would never claim to know everything or try to reinvent the wheel where good work has already been done - would you?

Hani wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 06-02-2008 6:32 AM

Hi,

I face problem, I do all steps but when i try go to web application policy I have this error The entry 'AspNetWindowsTokenRoleProvider' has already been added. in central admin  webconfig

Anders wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 06-02-2008 5:37 PM

One word: Brilliant!

vikram wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 06-07-2008 2:10 PM

hi,

is there a way to allow SSO for users of another AD domain- 2 way trust exists already. i couldn't see this option in the site operations section. we're on 2007 sharepoint.

Ravi wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 06-11-2008 3:16 PM

There are some known issues with Forms based authentication for client integration msdn.microsoft.com/.../bb977430.aspx

There are some workarounds but what if the workarounds like click remember me are not accepted by the client? Is there a way to configure a second AD for the extranet users? Is there any documentation as how to do this on a VPC for development purposes?

Renier wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 08-07-2008 1:17 PM

Does anyone know whether it is possible to configure MOSS to authenticate users based on membership of two seperate groups, i.e. if user is a member of Group A AND a member of Group B (while group A and B are not related)

Karim wrote re: Defining multiple authentication providers to a single MOSS 2007 web application
on 12-17-2008 3:54 PM

I'd like to use a .net 2.x membership database that is already live and associated with a custom .net 3.5 framework application.  Is it known how/whether using this for MOSS as well might affect the membership database?  I'm guessing that the only change will be the addition of some roles?

Migraci?n de Notes a MOSS | hilpers wrote Migraci?n de Notes a MOSS | hilpers
on 01-17-2009 2:06 PM

Pingback from  Migraci?n de Notes a MOSS | hilpers

AD Provider for multiple domains | keyongtech wrote AD Provider for multiple domains | keyongtech
on 01-18-2009 10:49 AM

Pingback from  AD Provider for multiple domains | keyongtech

Authentication Question | keyongtech wrote Authentication Question | keyongtech
on 01-21-2009 11:13 PM

Pingback from  Authentication Question | keyongtech

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.