IdeaBlade.EntityModel.Compat Assembly > IdeaBlade.EntityModel.Compat Namespace > AuthenticatorAsyncExtensions Class : LoginAsync Method |
'Declaration
<ExtensionAttribute()> Public Shared Function LoginAsync( _ ByVal authenticator As Authenticator, _ ByVal credential As ILoginCredential, _ ByVal options As LoginOptions, _ ByVal userCallback As Action(Of LoginOperation), _ Optional ByVal userState As Object _ ) As LoginOperation
'Usage
Dim authenticator As Authenticator Dim credential As ILoginCredential Dim options As LoginOptions Dim userCallback As Action(Of LoginOperation) Dim userState As Object Dim value As LoginOperation value = AuthenticatorAsyncExtensions.LoginAsync(authenticator, credential, options, userCallback, userState)
[Extension()] public static LoginOperation LoginAsync( Authenticator authenticator, ILoginCredential credential, LoginOptions options, Action<LoginOperation> userCallback, object userState )
You can pass a null (Nothing in Visual Basic) in place of an IdeaBlade.EntityModel.ILoginCredential object. Null credentials can indicate either that the user is logging in as a guest or anonymous user, or when using the AspAuthenticatingLoginManager that the current authenticated user should be loaded. When using ASP.NET the current authenticated user is one authenticated via Windows authentication, or is the user already logged in because of either a persistent cookie or a login performed elsewhere in the ASP.NET application. If you are not using the AspAuthenticationLoginManager then your implementation of IdeaBlade.EntityModel.IEntityLoginManager should handle a null credential if your client application can provide one.
The AllowAnonymousLogin flag in the IdeaBlade configuration determines whether "anonymous" users can login to your application. Anonymous users are ones who have not supplied credentials and who also cannot be authenticated by other means, such as ASP.NET authentication.
Provide a userCallback if you want to be notified when the operation completes. Use the userState to uniquely identify this call.
The IdeaBlade.EntityModel.Security.AuthenticationContext returned from a successful login in the IdeaBlade.EntityModel.LoginOperation or IdeaBlade.EntityModel.LoginEventArgs can be used in two ways: 1) you can set the DefaultAuthenticationContext so that any IdeaBlade.EntityModel.EntityManager in your application will share the credentials and not require a separate login, or 2) you can set the IdeaBlade.EntityModel.EntityManager.AuthenticationContext on one or more EntityManager instances. Note that without performing one of these actions the returned AuthenticationContext will not be used by DevForce.
Credentials are passed in clear text. Use a secure channel (such as SSL) or provide your own encryption if secure communications are necessary.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2