AuthenticationBase<T>.Login Method
[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]
Authenticates and returns the user with the specified name and password.
Namespace: System.ServiceModel.DomainServices.Server.ApplicationServices
Assembly: System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)
Syntax
'Declaration
Public Function Login ( _
userName As String, _
password As String, _
isPersistent As Boolean, _
customData As String _
) As T
'Usage
Dim instance As AuthenticationBase
Dim userName As String
Dim password As String
Dim isPersistent As Boolean
Dim customData As String
Dim returnValue As T
returnValue = instance.Login(userName, _
password, isPersistent, customData)
public T Login(
string userName,
string password,
bool isPersistent,
string customData
)
public:
virtual T Login(
String^ userName,
String^ password,
bool isPersistent,
String^ customData
) sealed
abstract Login :
userName:string *
password:string *
isPersistent:bool *
customData:string -> 'T
override Login :
userName:string *
password:string *
isPersistent:bool *
customData:string -> 'T
public final function Login(
userName : String,
password : String,
isPersistent : boolean,
customData : String
) : T
Parameters
- userName
Type: System.String
The user name associated with the user to authenticate.
- password
Type: System.String
The password associated with the user to authenticate.
- isPersistent
Type: System.Boolean
A value that indicates whether the authentication should persist between sessions.
- customData
Type: System.String
Optional implementation-specific data. It is unused by this base class.
Return Value
Type: T
A single user or nulla null reference (Nothing in Visual Basic) if authentication failed.
Implements
IAuthentication<T>.Login(String, String, Boolean, String)
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | The ASP.NET authentication mode is not AuthenticationMode.Forms. |
Remarks
By default, this method can be only used for forms authentication and leverages ASP.NET Membership and Forms authentication.
See Also
Reference
System.ServiceModel.DomainServices.Server.ApplicationServices Namespace