0

I'm tring to outsource my aura component with lightning out using a connected app but I have a 500 error. (I have no problem connecting with the user/password/token mode). CORS are well set (localhost:5000 here)

enter image description here

I tried to setup logs in salesforce but I have nothing but I can see connection success

enter image description here

Lightning out script :

<head>  
    <script type="text/javascript"  src="https://******.lightning.force.com/lightning/lightning.out.js"></script>
</head>
<body>
    <div id="auraLightning"></div>
</body>

<script>
    $Lightning.use(
        "c:ParentDDCApp",
        function(){
            $Lightning.createComponent(
                "c:ParentAura",
                { msg: "It works (Aura)2!",
                callback : lightningCallback 
            ,
                "auraLightning",
                (cmp) => {
                    console.log("Aura component was created");
                }
            );          
        },
        "https://**********.lightning.force.com",
        "myToken"
    );
    //Function to call from Lightning Component
    function lightningCallback(theMsg){
        console.log('On WebSite: ' + theMsg);
        alert(theMsg);}


</script>

My aura app ParentDDCApp :

<aura:application access="GLOBAL" extends="ltng:outApp">
  <aura:dependency resource="c:parentDDCAura"/>
</aura:application>

My Aura component parentDDCAura:

<aura:component >
   <aura:attribute name="msg" type="String" default="No Message passed!" />
Hello

</aura:component>

I think the problem is with the connected app parameters but can't find how to fix it

0

Finally found the problem : the profile we used to display the componnent was "API Only", what doesn't work to display Lightning out component. When we display it with a standard "read only" profile and the Permission set for the objects use by the compenent, we dont have the problem anymore.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.