Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

AuthenticationService Class

WCF RIA Services

[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.]

Provides a base class for services that authenticate, load, and save the current user.

System.Object
  System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationService
    System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService

Namespace:  System.ServiceModel.DomainServices.Client.ApplicationServices
Assembly:  System.ServiceModel.DomainServices.Client (in System.ServiceModel.DomainServices.Client.dll)
public abstract class AuthenticationService implements INotifyPropertyChanged

The AuthenticationService type exposes the following members.

  NameDescription
Protected methodAuthenticationServiceInitializes a new instance of the AuthenticationService class.
Top
  NameDescription
Public propertyIsBusyGets a value indicating whether an asynchronous operation is in progress.
Public propertyIsLoadingUserGets a value indicating whether an asynchronous LoadUser operation is in progress.
Public propertyIsLoggingInGets a value indicating whether an asynchronous Login operation is in progress.
Public propertyIsLoggingOutGets a value indicating whether an asynchronous Logout operation is in progress.
Public propertyIsSavingUserGets a value indicating whether an asynchronous SaveUser operation is in progress.
Protected propertySupportsCancellationGets a value indicating whether this authentication implementation supports cancellation.
Public propertyUserGets a principal representing the authenticated user.
Top
  NameDescription
Protected methodBeginLoadUserBegins an asynchronous LoadUser operation.
Protected methodBeginLoginBegins an asynchronous Login operation.
Protected methodBeginLogoutBegins an asynchronous Logout operation.
Protected methodBeginSaveUserBegins an asynchronous SaveUser operation.
Protected methodCancelLoadUserCancels an asynchronous LoadUser operation.
Protected methodCancelLoginCancels an asynchronous Login operation.
Protected methodCancelLogoutCancels an asynchronous Logout operation.
Protected methodCancelSaveUserCancels an asynchronous SaveUser operation.
Protected methodCreateDefaultUserCreates a default user.
Protected methodEndLoadUserEnds an asynchronous LoadUser operation.
Protected methodEndLoginEnds an asynchronous Login operation.
Protected methodEndLogoutEnds an asynchronous Logout operation.
Protected methodEndSaveUserEnds an asynchronous SaveUser operation.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodLoadUser()Asynchronously loads the authenticated user from the server.
Public methodLoadUser(Action(LoadUserOperation), Object)Asynchronously loads the authenticated user from the server with specified callback method and user state.
Public methodLogin(LoginParameters)Asynchronously authenticates and logs in to the server with the specified parameters.
Public methodLogin(String, String)Asynchronously authenticates and logs in to the server with the specified user name and password.
Public methodLogin(LoginParameters, Action(LoginOperation), Object)Asynchronously authenticates and logs in to the server with the specified parameters, callback method, and user state.
Public methodLogout(Boolean)Asynchronously logs out an authenticated user from the server with the specified value indicating whether an exception is thrown for errors.
Public methodLogout(Action(LogoutOperation), Object)Asynchronously logs out an authenticated user from the server with the specified callback method and user state.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnPropertyChangedRaises a PropertyChanged event.
Protected methodRaisePropertyChangedRaises a PropertyChanged event for the specified property.
Public methodSaveUser(Boolean)Asynchronously saves the authenticated user to the server with the specified value indicating whether an exception is thrown for errors.
Public methodSaveUser(Action(SaveUserOperation), Object)Asynchronously saves the authenticated user to the server with the specified callback method and user state.
Public methodToString (Inherited from Object.)
Top
  NameDescription
Public eventLoggedInOccurs when a new user is successfully logged in.
Public eventLoggedOutOccurs when a user is successfully logged out.
Top
  NameDescription
Explicit interface implemetationPrivate eventINotifyPropertyChanged.PropertyChangedOccurs every time a property value changes.
Top

This abstract base class exposes Login, Logout, LoadUser, and SaveUser as asynchronous operations. It also provides a number of properties that can be bound to, including IsBusy and User.

Implementations of this class will have a much different view by using several abstract template methods. These methods follow the asynchronous result pattern and are presented in Begin/End pairs for each operation. Optionally, cancel methods for each operation can also be implemented.

For a complete example of implementing an authentication service, see Walkthrough: Using Authentication Service with Silverlight Navigation Application.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.