Steps for the Alternative Membership Provider

by chris 12/18/2007 10:15:38 AM

For those interested in switching providers here are the steps that I used.

1.    Backup your web.config file to a safe place (just in case)
2.    Download the latest XML Provider release (currently 1.3) from http://artembg.com/downloads
3.    From the downloaded zip file, copy the 2 files in the zip into the ~/bin folder
4.    Open your web.config file with your favorite editor
5.    Locate the <membership> section and delete it.
6.    Locate the <rolemanager> section and delete it.
7.    Add the following information (info at http://artembg.com/project/xmlproviders)

<membership defaultProvider="XmlMembershipProvider">
    <providers>
        <clear/>
        <add applicationName="YOUR_APP"
             name="XmlMembershipProvider"
            type="Artem.Web.Security.XmlMembershipProvider"
            minRequiredPasswordLength="1"
            minRequiredNonAlphanumericCharacters="0"
            requiresQuestionAndAnswer="false"
            requiresUniqueEmail="false"
            passwordFormat="Hashed"/>
    </providers>
</membership>

<roleManager enabled="true" defaultProvider="XmlRoleProvider">
    <providers>
        <clear/>
        <add applicationName="YOUR_APP"
             name="XmlRoleProvider"
             type="Artem.Web.Security.XmlRoleProvider"/>
    </providers>
</roleManager>

<profile enabled="true" defaultProvider="XmlProfileProvider">
    <providers>
        <clear/>
        <add applicationName="YOUR_APP"
             name="XmlProfileProvider"
             type="Artem.Web.Security.XmlProfileProvider"/>
    </providers>
</profile>


8.    Update the previous sections to replace YOUR_APP with a unique name for your app (usually the same as your <Forms> application name.
9.    Save your web.config file.
10.    Create a new ~/app_data/Users.config file and insert the following information:

<?xml version="1.0"?>
<ArrayOfXmlUser xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <XmlUser>
    <UserKey>1d58a733-3d5f-422a-9458-7c1d35624414</UserKey>
    <UserName>admin</UserName>
    <Password>2CD5E78F16D801ED32F39DFA8B7D9417B2B5D2F6</Password>
    <PasswordSalt>Wt4yt0QTdM5leRIfLuZx1w==</PasswordSalt>
    <Email>admin@localhost.local</Email>
    <CreationDate>2007-12-18T09:55:18.8015744-08:00</CreationDate>
    <LastActivityDate>2007-12-18T09:55:18.8015744-08:00</LastActivityDate>
    <LastLoginDate>0001-01-01T00:00:00</LastLoginDate>
    <LastPasswordChangeDate>2007-12-18T09:55:18.8015744-08:00</LastPasswordChangeDate>
  </XmlUser>
</ArrayOfXmlUser>

11.    Create a new ~/app_data/Roles.config file and insert the following information:

<?xml version="1.0"?>
<ArrayOfXmlRole xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <XmlRole>
    <Name>Administrators</Name>
    <Users>
      <string>admin</string>
    </Users>
  </XmlRole>
  <XmlRole>
    <Name>Editors</Name>
    <Users>
      <string>member</string>
    </Users>
  </XmlRole>
</ArrayOfXmlRole>

12.    Open up your browser and connect to your blog.
13.    Login into your blog using the credentials:

            Username: admin
            Password: admin

14.    Go to the Users page and create a new user.
15.    Log out of the blog and verify you can log back in with your new account.
16.    Go back to the Users page and delete the admin account.
17.    You should be done.

Comments

Add comment


(Will show your Gravatar icon)  

biuquote
  • Comment
  • Preview
Loading




Powered by BlogEngine.NET Theme by Mads Kristensen Hosted by 1and1 Hosting Sign in
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way. © 2008 Chris Blankenship

DSCODUC on Technorati  

Stop Spam Harvesters, Join Project Honey Pot   This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License  

Welcome to my blog

Welcome to my site

Villainy wears many masks,
none of which so dangerous as virtue…



LinkedIn   GeoURL

Recent Comments

Comment RSS

Wordle Gallery

Shelfari Book Library