Once you've created a SessionMgr
object, you can log the user on to the Crystal Enterprise system using the member function Logon
.
//Log the user on to Crystal Enterprise.
Sess = SessionManager.Logon(UserID, Password, APS, Aut);
//Check to see if logon failed.
//If the logon failed, show a message box with an error description.
Response.Write ("<SCRIPT language=\"javascript\"> " +
" alert (\"Sorry - you could not be logged on to " +
"this server. Ensure that your user name and " +
"password, as well as the APS name are correct. " +
//Redirect the user back to the logon page.
Response.Write ("<META HTTP
The most important line of code follows.
Sess = SessionManager.Logon(UserID, Password, APS, Aut);
If the user successfully logs on, then a valid EnterpriseSession
is returned. However, if the user cannot log on (for example, if the password is invalid), then Logon
throws an error. If you are using JavaScript, use the Err object to catch the error.
Alternatively, a user may logon using a method called Single Sign On (SSO). Using SSO, it is possible for a user who has logged on to a Windows NT workstation to log on to an Enterprise desktop without entering a user name or password. To do this, you must first set up the Web Component Server and the Web Server to use SSO. For information on doing this, see "Setting up NT Single Sign On" in the Crystal Enterprise Administrator's Guide. Once the servers have been configured, the user may log on with a blank user name and password using the Windows NT authentication method. In this case, the system will log them on using their current Windows NT credentials. To view an example using SSO, see SSOLogon.csp.
Note: SSO will only work if you are using Microsoft IIS and users are using Microsoft Internet Explorer as their web browser.
Crystal Decisions, Inc. http://www.crystaldecisions.com Support services: http://support.crystaldecisions.com |