SPSecurity.AuthenticationMode property

Gets the user authentication mode for the SharePoint deployment.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Shared ReadOnly Property AuthenticationMode As AuthenticationMode
Dim value As AuthenticationMode

value = SPSecurity.AuthenticationMode
public static AuthenticationMode AuthenticationMode { get; }

Property value

Type: System.Web.Configuration.AuthenticationMode
An AuthenticationMode that specifies whether the SharePoint deployment is using Windows, Microsoft ASP.NET 2.0 Forms-based, or custom authentication of users.


This value is set with the <authentication> element in the web.config file. But if the calling code is inside a method passed to RunWithElevatedPrivileges, AuthenticationMode returns Windows, regardless of the setting in web.config.

To create a customized authentication system, set the <authentication> element in the web.config file to "None". Then add an authentication module and a membership and role provider.


Microsoft SharePoint Foundation 2010 does not support Windows Live ID authentication.

See also


SPSecurity class

SPSecurity members

Microsoft.SharePoint namespace


Other resources

Authentication, authorization, and security in SharePoint 2013

ASP.NET Authentication