Skip to main content

Posts

Showing posts from September, 2018

Embed Wave in Any Web Page or Web-Based App using Lightning out

 Embed Wave in Any Web Page or Web-Based App using Lightning out   As per the salesforce document Embed Dashboards Everywhere ,To embed Analytics in any web page or web-based app,   First, We need to add an Analytics dashboard component to your site, using Visualforce embedding, Lightning App Builder, or Lightning Out. This code sample shows how to add an Analytics dashboard component via Lightning Out. $Lightning.use("wave:waveApp", function() { $Lightning.createComponent("wave:waveDashboard", { dashboardId: "0FKxx00000006bOGAQ" }, "app"); }, url, accessToken) Second, set up a whitelist using the Content Security Policy (CSP). See Set Up a Whitelist of Trusted Sites for Embedded Analytics Dashboards. The whitelist for embedded Analytics includes the following by default: *.salesforce.com:* *.force.com:* Your org’s custom domain. However while implementing the above code, We might face some errors regarding CORS or Lightning errors eve

Invalid_grant Authentication Failure in Username-Password Oauth flow

Sometimes the delegated authentication is configured in the customer's org for the logged-in user. So when the username and password is given during login, the authentication will be done via delegated authentication server, not by salesforce. We have seen a strange behavior in Username-Password OAUTH flow (Sept 6, 2018) when the request is made from API and Apex. 1. When OAUTH request made via api, You can pass external auth server password. grant_type:password username:username@gmail.com password:password  // This can be external system password client_id:3MV***log.W client_secret:65***58 2. When OAUTH request made via apex, The password should be salesforce password along with security token. If the external system password is given, you will get the below error 13:26:23.1 (5805772)|CALLOUT_REQUEST|[74]|System.HttpRequest[Endpoint=https://****.my.salesforce.com/services/oauth2/token, Method=POST] 13:26:23.1 (357570230)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:952 13:26:23.1 (357762371)|CA