// This file attempts to logon a user using the Single Sign On
// method. If the logon fails, then the user is directed to a
// logon form. Note that both the WCS and the Web Server
// must be configured for SSO before this works.
<META HTTP
<!-- #include file=helper_js.csp -->
var UserID, Password, APS, Aut;
//Retrieve the name of the server to logon to.
APS = Request.ServerVariables.Item("WCS_NAME_SERVER");
//The UserID and Password are empty for SSO.
//NT Authentication must be used in order to use SSO.
//Create an Enterprise SessionManager.
SessionManager = Server.CreateObject("CrystalEnterprise.SessionMgr");
Response.Write ("Couldn't create SessionManager");
//Log the user onto Crystal Enterprise using SSO.
//Note that the authentication type is secWindowsNT
//and that the UserID and password are blank.
Sess = SessionManager.Logon(UserID, Password, APS, Aut)
//If logon failed, redirect the user back to the logon page.
Response.Redirect ("LogonForm.csp");
//Create the InfoStore object.
IStore = Sess.Service ("", "InfoStore");
//Store the InfoStore object in the session.
//Retrieve the LogonTokenManager.
LogonTokenMgr = Sess.LogonTokenMgr;
//Retrieve a logon token and store it in the user's cookie file for later use.
SetCookie("LogonToken", LogonTokenMgr.CreateLogonTokenEx("", 60, 100));
//Redirect the user to the site's home page.
Response.Redirect ("Home.csp
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |