Lightning Out for unauthenticated users
In the last section, we required a connected app and authentication from Salesforce to render the Lightning Component. Authentication is needed if you want the application to securely fetch data from Salesforce using the user credentials.
However, let's say you want a non-secure component to be hosted on your site. An example could be a simple web to read form or a contact information collection form, and you do not want your users to log in.
For this scenario, the Lightning Out application will implement a special interface named ltng:allowGuestAccess
and you will also need to create a Salesforce community that is published for the public.
Let's take a step-by-step walkthrough of how to take components outside Salesforce for unauthenticated users:
- Create a Lightning Out dependency app that implements
ltng:allowGuestAccess
. The simple code modification to our YouTube Lightning Out application will be as follows. The name of the app isyoutubesearchOutApp...