CustomAuthenticator Class TIBCO Spotfire 7.6 API Reference
This class enables a third-party to implement a custom authenticator for the Web Player server.
Inheritance Hierarchy

SystemObject
  Spotfire.Dxp.WebCustomAuthenticator

Namespace: Spotfire.Dxp.Web
Assembly: Spotfire.Dxp.Web (in Spotfire.Dxp.Web.dll) Version: 25.11.10401.3615 (25.11.10401.3615)
Syntax

C#
public abstract class CustomAuthenticator

The CustomAuthenticator type exposes the following members.

Constructors

  NameDescription
Protected methodCustomAuthenticator
Initializes a new instance of the CustomAuthenticator class.
Top
Methods

  NameDescription
Protected methodAuthenticateTokenCore
Performs the user authentication. The AuthenticationContext parameter can be used to retrieve information about the user to authenticate.
Protected methodStatic memberCreateIdentity
Creates a Spotfire specific instance of the IIdentity interface from a user name string.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodIsLogoutEnabledCore
Override this to specify whether logout should be enabled.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Top
Remarks

When implementing a derived class of CustomAuthenticator, an implementation of the AuthenticateTokenCore(AuthenticationContext) must be provided. It is recommended that an AuthenticationException is thrown if the custom authentication fails.
Examples

This sample shows how to create a simple custom authenticator.
C#
// Custom autenticator class. 
// Note: For brevity, some details are intentionally omitted. 

public class TestAuthenticator : CustomAuthenticator
{
   // Empty constructor required
   public TestAuthenticator() : base()
   {
   }

   protected override IIdentity AuthenticateTokenCore(AuthenticationContext context)
   {
       string userName = String.Empty;
       string portalConnectionInfo = null;
       // Assuming the token is contained in the request header
       string token = context.Context.Request.Headers["token"];

       System.Configuration.Configuration webConfig =
           System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null);

       // This exampel relies on custom settings.
       if (0 < webConfig.AppSettings.Settings.Count)
       {
           System.Configuration.KeyValueConfigurationElement customSetting =
               webConfig.AppSettings.Settings["PortalConnectionInfo"];

           // Required setting throw exception if it doesn't exist.
           if (null != customSetting)
           {
               portalConnectionInfo = customSetting.Value;
           }
           else
           {
               // Error, throw exception
           }
       }
       else
       {
           // Error, throw exception
       }

       // 
       // Authenticate against the Portal server using
       // portalConnectionInfo, assign the user name
       // corresponding to the <c>token</c> to the 
       // <c>userName</c> parameter. 
       // 

       // Use the CreateIdentity helper method to create an
       // IIdentity object of correct type. 
       return CreateIdentity(userName);
   }
}
Version Information

Supported in: 7.5, 7.0, 6.5, 6.0, 5.5, 5.0
See Also

Reference