Export (0) Print
Expand All

AuthenticationBase<T> 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 domain service that encapsulates the authentication domain.

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)

public abstract class AuthenticationBase<T> : DomainService, 
	IAuthentication<T>
where T : new(), IUser

Type Parameters

T

The type of the user entity.

The AuthenticationBase<T> type exposes the following members.

  NameDescription
Protected methodAuthenticationBase<T>Initializes a new instance of the AuthenticationBase<T> class.
Top

  NameDescription
Protected propertyAuthorizationContextGets or sets the optional template AuthorizationContext to use for IsAuthorized. (Inherited from DomainService.)
Protected propertyChangeSetGets the current ChangeSet. (Inherited from DomainService.)
Protected propertyServiceContextGets the active DomainServiceContext for this DomainService. (Inherited from DomainService.)
Protected propertyServiceDescriptionGets the DomainServiceDescription for this DomainService. (Inherited from DomainService.)
Protected propertyValidationContextGets or sets the optional ValidationContext to use for all validation operations invoked by the DomainService. (Inherited from DomainService.)
Top

  NameDescription
Protected methodAuthorizeChangeSetReturns a value that indicates the whether the user is authorized to submit the specified ChangeSet. (Inherited from DomainService.)
Protected methodClearAuthenticationTokenClears any issued authentication token.
Protected methodCount<T>Returns the number of rows in an IQueryable. (Inherited from DomainService.)
Protected methodCreateUserCreates a new instance of T and initializes it with default values.
Public methodDispose()Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.)
Protected methodDispose(Boolean)Releases all resources used by the current instance of the DomainService class. (Inherited from DomainService.)
Public methodEquals (Inherited from Object.)
Protected methodExecuteChangeSetInvokes the DomainOperationEntry for each operation in the ChangeSet. (Inherited from DomainService.)
Protected methodFinalize (Inherited from Object.)
Protected methodGetAnonymousUserGets an anonymous user.
Protected methodGetAuthenticatedUserGets the user for the authenticated principal.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodGetUserGets the principal and profile for the current user.
Public methodInitializeInitializes this DomainService. (Inherited from DomainService.)
Public methodInvokeInvokes the specified operation. (Inherited from DomainService.)
Public methodIsAuthorizedRequests authorization for the specified DomainOperationEntry. (Inherited from DomainService.)
Protected methodIssueAuthenticationTokenIssues a token for the authenticated principal.
Public methodLoginAuthenticates and returns the user with the specified name and password.
Public methodLogoutLogs out an authenticated user.
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodOnErrorCalled whenever an unrecoverable error occurs during the processing of a DomainService operation. (Inherited from DomainService.)
Protected methodPersistChangeSetFinalizes changes after all the operations in the ChangeSet have been invoked. (Inherited from DomainService.)
Public methodQueryPerforms the query operation indicated by the specified QueryDescription. (Inherited from DomainService.)
Public methodSubmitPerforms the operations indicated by the specified ChangeSet by invoking each of the corresponding domain operations. (Inherited from DomainService.)
Public methodToString (Inherited from Object.)
Public methodUpdateUserUpdates the profile for the authenticated user.
Protected methodUpdateUserCoreUpdates the user data for the authenticated identity.
Protected methodValidateChangeSetValidates the whole ChangeSet before calling ExecuteChangeSet. (Inherited from DomainService.)
Protected methodValidateUserVerifies that the supplied user name and password are valid.
Top

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft