The ScreenSteps Online Knowledge Base Everything you need to know about ScreenSteps
Blue mango logo white 250
  • Table of Contents
  • Contact Us
ScreenSteps Documentation » ScreenSteps Live Remote Authentication » Creating the Controller

Topics

  • 1. Remote Authentication 6
    • 1.1 What is Remote Authentication?
    • 1.2 How do I Enable Remote Authentication On My Account?
    • 1.3 SAML Settings
    • 1.4 ScreenSteps Live Remote Auth Settings
    • 1.5 Granting Remotely Authenticated Users Automatic Access to a Space
    • 1.6 How Do I Get Back Into My Account if I Have Accidentally Locked Myself Out?
  • 2. ScreenSteps Live Remote Authentication 2
    • 2.1 How Do I Remotely Authenticate a User using ScreenSteps Live Remote Authentication?
    • 2.2 How Can I Log a User Into ScreenSteps Live Using PHP And ScreenSteps Live Remote Authentication?
  • 3. WordPress Plugin 2
    • 3.1 Installing the WordPress Plugin
    • 3.2 Configuring the WordPress Plugin
  • 4. Using Remote Authentication with Atlassian Crowd 6
    • 4.1 Overview
    • 4.2 Uploading the PHP Scripts
    • 4.3 Adding An Application In Crowd
    • 4.4 Setting Up Remote Authentication in ScreenSteps Live
    • 4.5 Configuring the PHP Script
    • 4.6 Testing
  • 5. Using SAML with OneLogin 1
    • 5.1 Configuring SAML with OneLogin
  • 6. Using SAML with Salesforce.com 3
    • 6.1 Configuring SAML with Salesforce.com
    • 6.2 Generating a self-signed certificate on Salesforce.com
    • 6.3 Authenticating Salesforce users for creating and updating lessons
  • 7. Using ScreenSteps Live Remote Authentication with Salesforce.com 6
    • 7.1 Overview
    • 7.2 Configuring ScreenSteps Live
    • 7.3 Creating the Controller
    • 7.4 Creating the Visualforce Page
    • 7.5 Setting Permissions for the Visualforce Page
    • 7.6 Test: Logging Into ScreenSteps Live with Salesforce Credentials

Quicklinks

  • Downloads
  • View forums
  • Submit a help request
  • Contact us
  • Retrieve a lost license key

Last Updated

Feb 07, 2011

Download Manual PDF

Other Resources

  • ScreenSteps Desktop & Workgroup

  • ScreenSteps 2.9
  • ScreenSteps Workgroup
  • Customizing HTML Templates
  • ScreenSteps: Tips & Tricks
  • Creating Word Templates
  • Publishing to Blogs & Wikis
  • ScreenSteps Live

  • ScreenSteps Live
  • Setting up a New Admin, Editor or Author on ScreenSteps Live
  • ScreenSteps Live Support Client
  • Integrating ScreenSteps Live With Other Services
  • Collaborating on ScreenSteps Live
  • ScreenSteps Live Remote Authentication
  • ScreenSteps Live API
  • API Examples
  • Implementation Guides

  • Creating a Software Manual With ScreenSteps
  • Creating a ScreenSteps Live Support Site
  • Zendesk and ScreenSteps Live
  • Help Scout and ScreenSteps Live
  • FAQs

  • FAQs

Comments

0 comments for this lesson

  • Prev: Configuring ScreenSteps Live
  • Next: Creating the Visualforce Page

Creating the Controller

Now that you have configured ScreenSteps Live you need to create a controller and a page in Salesforce.com. We will begin by creating the Controller for the Visualforce page.

Navigate to your Salesforce.com Setup Area

Media_1292426680053

Navigate to Apex Classes Page

Media_1292426712053

From the menu, expand Develop and click on Apex Classes.

Create a New Class

Media_1292426800945

Click on the New button to create a new class.

Paste In ScreenStepsLiveRemoteLoginController Code

Media_1292426827667

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 () {
        // UserInfo does not expost the email address
        String theUserName = UserInfo.getUserName();
        User activeUser = [Select Email From User where Username = : theUserName limit 1];
        String theEmail = activeUser.Email;
        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);
    }

    static testMethod void testTheController() {
        ScreenStepsLiveRemoteLoginController login = new ScreenStepsLiveRemoteLoginController();
    }
}
  • Prev: Configuring ScreenSteps Live
  • Next: Creating the Visualforce Page

Comments (0)

Add your comment

E-Mail me when someone replies to this comment
Blue Mango Learning Systems © 2012