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
Protected method AuthenticationBase<T> Initializes a new instance of the AuthenticationBase<T> class.

Top

Properties

Name Description
Protected property AuthorizationContext Gets or sets the optional template AuthorizationContext to use for IsAuthorized. (Inherited from DomainService.)
Protected property ChangeSet Gets the current ChangeSet. (Inherited from DomainService.)
Protected property ServiceContext Gets the active DomainServiceContext for this DomainService. (Inherited from DomainService.)
Protected property ServiceDescription Gets the DomainServiceDescription for this DomainService. (Inherited from DomainService.)
Protected property ValidationContext Gets or sets the optional ValidationContext to use for all validation operations invoked by the DomainService. (Inherited from DomainService.)

Top

Methods

Name Description
Protected method AuthorizeChangeSet Returns a value that indicates the whether the user is authorized to submit the specified ChangeSet. (Inherited from DomainService.)
Protected method ClearAuthenticationToken Clears any issued authentication token.
Protected method Count<T> Returns the number of rows in an IQueryable. (Inherited from DomainService.)
Protected method CreateUser Creates a new instance of T and initializes it with default values.
Public method Dispose() Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.)
Protected method Dispose(Boolean) Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.)
Public method Equals (Inherited from Object.)
Protected method ExecuteChangeSet Invokes the DomainOperationEntry for each operation in the ChangeSet. (Inherited from DomainService.)
Protected method Finalize (Inherited from Object.)
Protected method GetAnonymousUser Gets an anonymous user.
Protected method GetAuthenticatedUser Gets the user for the authenticated principal.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method GetUser Gets the principal and profile for the current user.
Public method Initialize Initializes this DomainService. (Inherited from DomainService.)
Public method Invoke Invokes the specified operation. (Inherited from DomainService.)
Public method IsAuthorized Requests authorization for the specified DomainOperationEntry. (Inherited from DomainService.)
Protected method IssueAuthenticationToken Issues a token for the authenticated principal.
Public method Login Authenticates and returns the user with the specified name and password.
Public method Logout Logs out an authenticated user.
Protected method MemberwiseClone (Inherited from Object.)
Protected method OnError Called whenever an unrecoverable error occurs during the processing of a DomainService operation. (Inherited from DomainService.)
Protected method PersistChangeSet Finalizes changes after all the operations in the ChangeSet have been invoked. (Inherited from DomainService.)
Public method Query Performs the query operation indicated by the specified QueryDescription. (Inherited from DomainService.)
Public method Submit Performs the operations indicated by the specified ChangeSet by invoking each of the corresponding domain operations. (Inherited from DomainService.)
Public method ToString (Inherited from Object.)
Public method UpdateUser Updates the profile for the authenticated user.
Protected method UpdateUserCore Updates the user data for the authenticated identity.
Protected method ValidateChangeSet Validates the whole ChangeSet before calling ExecuteChangeSet. (Inherited from DomainService.)
Protected method 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