function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ned KraushaarNed Kraushaar 

How to Pass the Current Case Id to a SAML-Enabled Connected App

Hello, I have configured a connected app that is SAML enabled.  I am displaying the app in a Visualforce page using an iframe as part of the Case layout page.  You can see below that the src attribute of the iframe references the connected app’s startup url and then the connected app (which is an asp.net web page) is loaded.
 
<apex:page standardController="Case" >
     <apex:iframe id="CaseFrame" width="100%" height="500" scrolling="true"  src="https://domain.my.salesforce.com/idp/login?app=0sp1O000000fxTs" />
</apex:page>
 
While loading, it builds a SAML assertion which it then posts to my asp.net app’s ACS url (assertion consumer service).  This url is a configuration setting in SFDC.  Because it redirects like this and does a post, I don’t see a simple way to pass custom parameters to my app as below…(passing the case id in the src url)
 
<apex:page standardController="Case" >
          <apex:iframe id="MyIFrame" width="100%" height="220px" scrolling="false"  src="https://mydomin.paasnational.com/FM.aspx?cid={!case.ID}" />
</apex:page>
 
I see there is a way to add custom parameters to the SAML assertion by extending the Auth.ConnectedAppPlugin class.  I could write a SOQL query here and load business data that my connected app could consume, but I don’t see a way to add the case id of the Case that the current user is viewing with this approach like in the iframe above. 
 
Does anyone know of an approach I could use to pass the current case id to my saml enabled connected app?  Thanks.
 
Kevin MerrittKevin Merritt
Did you ever find a solution to this problem?
Sanket NagpureSanket Nagpure
You can use directly CASE.ID  because you are using a standard controller.


<apex:page standardController="Case" >
     <apex:iframe id="CaseFrame" width="100%" height="500" scrolling="true"  src="https://domain.my.salesforce.com/idp/login?app={!Case.Id} />
</apex:page