Skip to main content

AuthenticationServiceClient Class

Provides the client-side functionality for the Report and Dashboard Server authentication service.

Namespace: DevExpress.ReportServer.ServiceModel.Client

Assembly: DevExpress.Printing.v24.1.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

public class AuthenticationServiceClient :
    ServiceClientBase,
    IAuthenticationServiceClient,
    IServiceClientBase

Remarks

To provide a custom authentication service to a RemoteDocumentSource, handle the RemoteDocumentSource.AuthenticationServiceClientDemanded event.

To automatically create a AuthenticationServiceClient, you can use the AuthenticationServiceClientFactory.Create method of an AuthenticationServiceClientFactory.

A FormsAuthenticationEndpointBehavior should be passed to both an authentication service and report service before each authentication attempt at the Report Server. This class traces the authentication cookie by using a FormsAuthenticationMessageInspector.

If the clients’ configuration is provided via the applicaiton’s .config file, the behavior of both these configurations must be specified in the same file.

The clients of an authentication service and the Report Server must share the cookie created on login.

  • In WinForms, this is provided by a FormsAuthenticationEndpointBehavior.
  • On the web, the behavior is specified in an application’s .config file, by adding the following lines to its <system.serviceModel> section.

    <extensions>
          <behaviorExtensions>
            <add name="formsAuthentication" type="DevExpress.ReportServer.ServiceModel.Client.FormsAuthenticationBehaviorExtension, DevExpress.Printing.v24.1.Core" />
          </behaviorExtensions>
        </extensions>
    
        <behaviors>
          <endpointBehaviors>
            <behavior name="formsAuthenticationBehavior">
              <formsAuthentication />
            </behavior>
          </endpointBehaviors>
        </behaviors>
    

    Without specifying endpoint configurations, assign the behavior to the AuthenticationServiceClientFactory.

    behavior = new FormsAuthenticationEndpointBehavior();
    authenticationFactory = new AuthenticationServiceClientFactory(authAddress, authType);
    authenticationFactory.ChannelFactory.Endpoint.Behaviors.Add(behavior); 
    factory = new ReportServerClientFactory(facadeAddress);
    factory.ChannelFactory.Endpoint.Behaviors.Add(behavior); 
    

Inheritance

Object
DevExpress.Data.Utils.ServiceModel.ServiceClientBase
AuthenticationServiceClient
See Also