Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

How to attone.lightning.force?

Asked by David Edmunds May 9, 2023 2.0K views 3 answers
Share

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}

Your answer

3 Answers

Francis Blackwell Latest answer

Answered on Dec 3, 2024

I've shared your incredibly thorough lessons with the watermelon game and wish more people knew about them.

Was this helpful?

Horpostiated

Answered on Nov 26, 2024

Your tutorials are so detailed, I have shared it to block blast and wish more people would know.

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.