Authenticates a user for the specified HttpContext.

Namespace: Novalys.VisualGuard.Security.WebForm
Assembly: Novalys.VisualGuard.Security.WebForm (in Novalys.VisualGuard.Security.WebForm.dll) Version: 2017.0.101.17 (2017.0.101.17)

Syntax

C#
public VGAuthenticationState Authenticate(
	HttpContext context,
	string name,
	string password,
	VGAuthenticationMode mode
)
Visual Basic
Public Function Authenticate ( 
	context As HttpContext,
	name As String,
	password As String,
	mode As VGAuthenticationMode
) As VGAuthenticationState

Parameters

context
Type: System.Web..::..HttpContext
A valid HttpContext representing the context for which the security is loaded.
name
Type: System..::..String
the name of the user.
password
Type: System..::..String
the password of the given user.
mode
Type: Novalys.VisualGuard.Security..::..VGAuthenticationMode
A VGAuthenticationMode indicating the mode of authentication used to authenticate the user

Return Value

Type: VGAuthenticationState
A VGAuthenticationState indicating if the authentication succeeds or not.

Remarks

This method will replace the User property. When the authentication fails, the User property is set to null. For more information about this method, you can see Authenticate(String, String, VGAuthenticationMode).

Exceptions

ExceptionCondition
System..::..ArgumentExceptionThe value of mode is equal to None or is a combination of several modes.

- or-

the name is an empty string or is longer than 64 characters.

- or-

the password is longer than 64 characters.
System..::..ArgumentNullException The name or the password or context is null (Nothing in VB) and the mode is not Windows.
System..::..NotSupportedException

the repository does not support the specified authentication mode.

Novalys.VisualGuard.Security..::..VGConfigurationExceptionThe configuration file is not valid

or

A problem occurs during the connection to the repository.

or

The version of the repository or the version of the permissions is not supported by the application.

See Also