Now that you have configured ScreenSteps, you need to create a controller and a page in Salesforce.com. We will begin by creating the Controller for the Visualforce page.
IMPORTANT: This must be done in a sandbox organization and then deployed to production.
Navigate to your Salesforce.com Setup Area
Remember that this must be in your sandbox organization.

Navigate to Apex Classes Page

From the menu, expand Develop and click on Apex Classes.
Create a New Class

Click on the New button to create a new class.
If you don't see the New button it is because you are in your production organization, not a sandbox organization.
Paste In ScreenStepsLiveRemoteLoginController Code

In the code field (1) paste the code that appears below. Make sure to replace the string INSERT_REMOTE_AUTH_TOKEN_HERE in the code with the remote authentication token you copied in the previous lesson.
After pasting in the code and inserting your token, click the Save button (2).
public class ScreenStepsLiveRemoteLoginController {
public string md5String {get;set;}
private string ssliveToken = 'INSERT_REMOTE_AUTH_TOKEN_HERE';
public ScreenStepsLiveRemoteLoginController () {
String theUserName = UserInfo.getUserName();
String theEmail = UserInfo.getUserEmail();
String theOrgName = ''; //UserInfo.getOrganizationName(); (not available in apex page)
String theReturnToURL = ApexPages.CurrentPage().getParameters().get('return_to_url');
String theTimeStamp = ApexPages.CurrentPage().getParameters().get('timestamp');
String theStringToHash = UserInfo.getFirstName() + UserInfo.getLastName() +
theEmail + UserInfo.getUserId() + theOrgName + this.ssliveToken + theTimeStamp;
Blob keyblob = Blob.valueof(theStringToHash);
Blob key = Crypto.generateDigest('MD5',keyblob);
md5String = encodingUtil.convertToHex(key);
}
}
The Test Class
Here is the APEX code for an accompanying test class.
@isTest
private class ScreenStepsLiveRemoteLoginControllerTest {
static testmethod void testSSLiveRemoteAuthToken() {
ScreenStepsLiveRemoteLoginController test = new ScreenStepsLiveRemoteLoginController();
System.assert(test.md5String != '');
}
}
I'm getting an error with the code. I copied and pasted directly from here into a new class and then pasted in the token as directed.
When I attempt to save, this is the error I get:
"Error: Compile Error: line 5:50 no viable alternative at character ' ' at line 5 column 50 "
Screencapture here: https://www.evernote.com/shard/s6/sh/5b1c0691-4ae6-4bec-ae18-79ca724b3f9c/2efcd59e12bc9ce82e9b5291fdb523b3
I tried looking through the code to see if I was missing something and noticed a discrepancy between the screen capture showing the class and the code ready to copy.
Here's the difference: https://www.evernote.com/shard/s6/sh/5b6cb78e-38dc-4154-b2f6-2d58b0e016f7/dee63ff497d3321ccccfcd1288a34ed8