SPSecurity.AuthenticationMode Property

Gets the user authentication mode for the SharePoint deployment.

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

Syntax

Public Shared ReadOnly Property AuthenticationMode As AuthenticationMode
    Get

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, Windows Live (formerly Passport), Microsoft ASP.NET 2.0 Forms-based, or custom authentication of users.

Remarks

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.

See Also

Reference

SPSecurity Class

SPSecurity Members

Microsoft.SharePoint Namespace

websvcAuthentication

Other Resources

Authorization and Authentication

ASP.NET Authentication