I'm creating an application that changes the authentication type to Claims based, but I'm trying not to use powershell. any advice?
2 Answers
To simply change application to Claims authentication from code you can use:
SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://testwebapp/"));
webApp.UseClaimsAuthentication = true;
webApp.Update();
But my suggestion is that you use PowerShell or Central Administration to setup Claims.
You can do the following steps:
- Open Central Administration.
- Click Application Management > Manage web application
- Select your Web application and then click Authentication provider.
- Click Default link and then configure your authentication.
-
-
Also, this is not correct. You cannot currently change from classic -> claims using Central Admin. Give it a try on a VM! Jul 23, 2011 at 20:43
-
I'm sorry but I saw that your title didn't include "in code" before :-). @Ben: good comment, mate ;-).– ThuanJul 24, 2011 at 1:18