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

System Object
  Spotfire.Dxp.Web CustomAuthenticator

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

public abstract class CustomAuthenticator
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.
// 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: 6.5, 6.0, 5.5, 5.0, 4.5
See Also