Skip to content

adamSellers/login-widget-example

Repository files navigation

login-widget-example

This simple app builds a basic PHP app running on Heroku and uses Salesforce Identity and the Login Widget project. Users have to log in to get access to data sheet.

Pre-requisites

You'll need an org that has a Community setup and active. Ideally you should have following the Salesforce External Identity Implementation Guide to set up this org or you have completed the Identity for Customers Trailhead module.

Steps to deploy

  1. Deploy this package to your org. The package is an Apex classes needed by the Login Widget
  2. Go to the force.com site that underlies your Community.
    • Click on public access settings and add 'SalesforceLoginWidgetXAuthServer' as an allowed Apex Class. Read this for more information on how to do this
    • Make the 'loginservice' and 'loginpage' VisualForce Pages publically accessible as well.
  3. Deploy this app to Heroku Deploy
  4. Create a Connected App
  5. Set the Heroku config vars via Setting > Reveal Config Vars:
    • "SALESFORCE_CLIENT_ID" to your Connected App's Consumer key
    • "SALESFORCE_COMMUNITY_URL" to the Community's domain, no trailing slash, and no https:// For example: mycommunity.force.com/community2
    • "SALESFORCE_HEROKUAPP_URL" to the Heroku app's domain, no trailing slash, and no https:// For example: strong-castle-20163.herokuapp.com
    • If you installed the package in a Salesforce Org with a namespace set, you must set the "SALESFORCE_NAMESPACE" config variable
  6. Open the app and enjoy!

About

An example of how to use Login Widget on a 3rd party site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published