About this question
I am struggling on how to expose lightning apps in force.com sites
As per one of the answers in this link I should be able to expose lightning apps on force.com sites :
Expose Lightning .app publicly?
I get a 500 error when the site accesses the lightning app. The same app renders fine on the visualforce page. What am I missing here? Is it even possible to expose a lightning app through a public site without authentication?
Lightning App:
VF Page used in force.com site:
[removed]
$Lightning.use("c:Lightningappforsite", function() {
$Lightning.createComponent("c:caseSearchcomponent",
"",
"lightning",
function(cmp) {
// do some stuff
});
});
[removed]
Output of component inside the VF Page:
Looking further in the console I see invalid session, looks like salesforce is expecting authentication to access the lightning component.
Console shows invalid session when i try to look at the raw request:
while(1); {"defaultHandler":"function(token) {try{$A.clientService.invalidSession(token);}catch(e){[removed].reload(true);}}","event":{"descriptor":"markup://aura:invalidSession","attributes":{"values":{}},"eventDef":{"descriptor":"markup://aura:invalidSession","type":"APPLICATION","xs":"I","superDef":{"descriptor":"markup://aura:applicationEvent"},"attributes":{"newToken":{"name":"newToken","type":"aura://String","xs":"I"}}}},"exceptionEvent":true}