This class enables a third-party to implement a custom authenticator for the Web Player
server.
Inheritance Hierarchy
Spotfire.Dxp.Web CustomAuthenticator
Namespace: Spotfire.Dxp.Web
Assembly: Spotfire.Dxp.Web (in Spotfire.Dxp.Web.dll) Version: 18.10.8513.5432 (18.10.8513.5432)
Syntax
Remarks
Examples
// 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
See Also