Skip to Content

Form Based Authentication in 2010

We use FBA in 2007 with a custom membershipprovider. This provider queries a custom databse to retrieve userID and PWD. Work very good in 2007, simple config. So how difficult can it be to do the same in 2010?

Well this is, according to me, FIM-like-shitty-SharePoint-Stuff; There are about a million blogs out there, but I found none of them telling the whole truth.
This one is a good start
http://chrisdomino.com/blog/post/Configuring-Custom-Providers-Using-Shar...
But is not telling the whole story (in case of migration)

It started with my dev environment (2008 R2, SPS with SP1); whatever I did, it kept on returning a System.ArgumentException parameter encodedValue. My dev was a standalone machine; I changed web.config of webapp, CA and STS (YES THIS MUST BE DONE) if you think why the hack.. All 3 are necessary; in a farm this is not a nice job..

So because I just could not get it to work in DEV, I focussed on my TEST environment, 2 WFE's 2 APPs and a SQL cluster; and he here the errors were much clearer; something like out of index errors on public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords); Indeed the code was wrong but somehow this worked in 2007... Anyway solving all (2-3) the errors I coudl loggin. YEah... but hey I have authentication but apparently no authorisation.... Seems the construction of loginnames is different:

You will have to migrate the users (look in table usersinfo, you will see something like providername:loginname in column tp_loginname, but is should be something like i:0#.f|providername|loginame). For this you will need to run MigrateUser on the webapplication. You find PS script here. This only talks about in-place migration, but the mirgateuser is also relevant for DB attach migration....
http://technet.microsoft.com/en-us/library/gg144572.aspx

Hope this helps anybody..