AuthenticationService Class
[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.
Inheritance Hierarchy
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)
Syntax
'Declaration
Public MustInherit Class AuthenticationService _
Implements INotifyPropertyChanged
'Usage
Dim instance As AuthenticationService
public abstract class AuthenticationService : INotifyPropertyChanged
public ref class AuthenticationService abstract : INotifyPropertyChanged
[<AbstractClassAttribute>]
type AuthenticationService =
class
interface INotifyPropertyChanged
end
public abstract class AuthenticationService implements INotifyPropertyChanged
The AuthenticationService type exposes the following members.
Constructors
Name | Description | |
---|---|---|
AuthenticationService | Initializes a new instance of the AuthenticationService class. |
Top
Properties
Name | Description | |
---|---|---|
IsBusy | Gets a value indicating whether an asynchronous operation is in progress. | |
IsLoadingUser | Gets a value indicating whether an asynchronous LoadUser operation is in progress. | |
IsLoggingIn | Gets a value indicating whether an asynchronous Login operation is in progress. | |
IsLoggingOut | Gets a value indicating whether an asynchronous Logout operation is in progress. | |
IsSavingUser | Gets a value indicating whether an asynchronous SaveUser operation is in progress. | |
SupportsCancellation | Gets a value indicating whether this authentication implementation supports cancellation. | |
User | Gets a principal representing the authenticated user. |
Top
Methods
Name | Description | |
---|---|---|
BeginLoadUser | Begins an asynchronous LoadUser operation. | |
BeginLogin | Begins an asynchronous Login operation. | |
BeginLogout | Begins an asynchronous Logout operation. | |
BeginSaveUser | Begins an asynchronous SaveUser operation. | |
CancelLoadUser | Cancels an asynchronous LoadUser operation. | |
CancelLogin | Cancels an asynchronous Login operation. | |
CancelLogout | Cancels an asynchronous Logout operation. | |
CancelSaveUser | Cancels an asynchronous SaveUser operation. | |
CreateDefaultUser | Creates a default user. | |
EndLoadUser | Ends an asynchronous LoadUser operation. | |
EndLogin | Ends an asynchronous Login operation. | |
EndLogout | Ends an asynchronous Logout operation. | |
EndSaveUser | Ends an asynchronous SaveUser operation. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
LoadUser() | Asynchronously loads the authenticated user from the server. | |
LoadUser(Action<LoadUserOperation>, Object) | Asynchronously loads the authenticated user from the server with specified callback method and user state. | |
Login(LoginParameters) | Asynchronously authenticates and logs in to the server with the specified parameters. | |
Login(String, String) | Asynchronously authenticates and logs in to the server with the specified user name and password. | |
Login(LoginParameters, Action<LoginOperation>, Object) | Asynchronously authenticates and logs in to the server with the specified parameters, callback method, and user state. | |
Logout(Boolean) | Asynchronously logs out an authenticated user from the server with the specified value indicating whether an exception is thrown for errors. | |
Logout(Action<LogoutOperation>, Object) | Asynchronously logs out an authenticated user from the server with the specified callback method and user state. | |
MemberwiseClone | (Inherited from Object.) | |
OnPropertyChanged | Raises a PropertyChanged event. | |
RaisePropertyChanged | Raises a PropertyChanged event for the specified property. | |
SaveUser(Boolean) | Asynchronously saves the authenticated user to the server with the specified value indicating whether an exception is thrown for errors. | |
SaveUser(Action<SaveUserOperation>, Object) | Asynchronously saves the authenticated user to the server with the specified callback method and user state. | |
ToString | (Inherited from Object.) |
Top
Events
Name | Description | |
---|---|---|
LoggedIn | Occurs when a new user is successfully logged in. | |
LoggedOut | Occurs when a user is successfully logged out. |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
INotifyPropertyChanged.PropertyChanged | Occurs every time a property value changes. |
Top
Remarks
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.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
System.ServiceModel.DomainServices.Client.ApplicationServices Namespace