I have a connected app that uses SSO (and thus it points to a SAML certificate). I include a canvas app in a Lightning component via force:canvasApp tag like the following:

<force:canvasApp developerName="MyConnectedAppDeveloperName" height="660" width="600" scrolling="no" />

I use that Lightning component in an Account record page (included via the Lightning App builder).

I want to pass some account fields information to the SAML response. In other words I want to append SAML parameters with account.LegacyId__c for example. That way, the remote report would display only information relevant to the current account the user is viewing.

I tried many approaches, read many forum posts with no success.

I tried customAttributes method on the Auth.ConnectedAppPlugin class (extending the class and overrding the method), like described in this documentation: ConnectedAppPlugin Class. But it didn't work, when I examined the SAML message with SAML tracker (Firefox extension) I don't see the custom attributes that I added. The developer on the external system don't see the attributes coming in in the SAML as well.

The custom attributes that we can add declaratively to the connected app are not helpful in my case, they only get information about the environment or the current user... not information from where the force:canvasApp was called from (in my case an account record).

I also tried the parameters attribute of the force:canvasApp component like described here force:canvasApp but I don't know how to pass that to the SAML.

Any ideas?


  • In order to manipulate the SAML response before it is sent, you need to use the ConnectedAppPlugin.modifySAMLResponse() method. Have you attempted this? – Mark Pond May 9 '18 at 1:15
  • I did, and actually the response is modified! But I still had the same issue, I could not find a way to access my context (which is in my case the Account record) from method modifySAMLResponse(). I can access the current user Id for example, but nothing much else. – Riadh Mankai May 9 '18 at 1:32

Your Answer

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

Browse other questions tagged or ask your own question.