AuthenticationBase<T> 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 domain service that encapsulates the authentication domain.
Inheritance Hierarchy
System.Object
System.ServiceModel.DomainServices.Server.DomainService
System.ServiceModel.DomainServices.Server.ApplicationServices.AuthenticationBase<T>
Namespace: System.ServiceModel.DomainServices.Server.ApplicationServices
Assembly: System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)
Syntax
'Declaration
Public MustInherit Class AuthenticationBase(Of T As {New, IUser}) _
Inherits DomainService _
Implements IAuthentication(Of T)
'Usage
Dim instance As AuthenticationBase(Of T)
public abstract class AuthenticationBase<T> : DomainService,
IAuthentication<T>
where T : new(), IUser
generic<typename T>
where T : gcnew(), IUser
public ref class AuthenticationBase abstract : public DomainService,
IAuthentication<T>
[<AbstractClassAttribute>]
type AuthenticationBase<'T when 'T : new() and IUser> =
class
inherit DomainService
interface IAuthentication<'T>
end
JScript does not support generic types and methods.
Type Parameters
- T
The type of the user entity.
The AuthenticationBase<T> type exposes the following members.
Constructors
Name | Description | |
---|---|---|
AuthenticationBase<T> | Initializes a new instance of the AuthenticationBase<T> class. |
Top
Properties
Name | Description | |
---|---|---|
AuthorizationContext | Gets or sets the optional template AuthorizationContext to use for IsAuthorized. (Inherited from DomainService.) | |
ChangeSet | Gets the current ChangeSet. (Inherited from DomainService.) | |
ServiceContext | Gets the active DomainServiceContext for this DomainService. (Inherited from DomainService.) | |
ServiceDescription | Gets the DomainServiceDescription for this DomainService. (Inherited from DomainService.) | |
ValidationContext | Gets or sets the optional ValidationContext to use for all validation operations invoked by the DomainService. (Inherited from DomainService.) |
Top
Methods
Name | Description | |
---|---|---|
AuthorizeChangeSet | Returns a value that indicates the whether the user is authorized to submit the specified ChangeSet. (Inherited from DomainService.) | |
ClearAuthenticationToken | Clears any issued authentication token. | |
Count<T> | Returns the number of rows in an IQueryable. (Inherited from DomainService.) | |
CreateUser | Creates a new instance of T and initializes it with default values. | |
Dispose() | Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.) | |
Dispose(Boolean) | Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.) | |
Equals | (Inherited from Object.) | |
ExecuteChangeSet | Invokes the DomainOperationEntry for each operation in the ChangeSet. (Inherited from DomainService.) | |
Finalize | (Inherited from Object.) | |
GetAnonymousUser | Gets an anonymous user. | |
GetAuthenticatedUser | Gets the user for the authenticated principal. | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
GetUser | Gets the principal and profile for the current user. | |
Initialize | Initializes this DomainService. (Inherited from DomainService.) | |
Invoke | Invokes the specified operation. (Inherited from DomainService.) | |
IsAuthorized | Requests authorization for the specified DomainOperationEntry. (Inherited from DomainService.) | |
IssueAuthenticationToken | Issues a token for the authenticated principal. | |
Login | Authenticates and returns the user with the specified name and password. | |
Logout | Logs out an authenticated user. | |
MemberwiseClone | (Inherited from Object.) | |
OnError | Called whenever an unrecoverable error occurs during the processing of a DomainService operation. (Inherited from DomainService.) | |
PersistChangeSet | Finalizes changes after all the operations in the ChangeSet have been invoked. (Inherited from DomainService.) | |
Query | Performs the query operation indicated by the specified QueryDescription. (Inherited from DomainService.) | |
Submit | Performs the operations indicated by the specified ChangeSet by invoking each of the corresponding domain operations. (Inherited from DomainService.) | |
ToString | (Inherited from Object.) | |
UpdateUser | Updates the profile for the authenticated user. | |
UpdateUserCore | Updates the user data for the authenticated identity. | |
ValidateChangeSet | Validates the whole ChangeSet before calling ExecuteChangeSet. (Inherited from DomainService.) | |
ValidateUser | Verifies that the supplied user name and password are valid. |
Top
Remarks
To add a domain service that facilitates authentication from the client, you add a class that derives from the AuthenticationBase<T> class to the server project. The default AuthenticationService on the client works with the generated DomainContext class to interact with a domain service that derives from the AuthenticationBase<T> class.
The UpdateUser method is designed as an update method, and is invoked by calling the SubmitChanges method on the client. This implementation has an important point to consider when developing your application. When you invoke UpdateUser by calling SaveUser, you submit all changes that have occurred in the DomainContext and may therefore invoke other update methods. Conversely, when you invoke other update methods on the DomainContext, you submit all changes in the domain context and may invoke the UpdateUser method.
By default, this authentication service relies on the ASP.NET providers for Membership, Roles, and Profile. The authentication service reflects any customizations made in those providers.
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.Server.ApplicationServices Namespace