You need to sign in to do that
Don't have an account?
RobertC
How to write a Test Class for the ConnectedAppPlugin Class?
I used the sample posted here in the help docs https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Auth_ConnectedAppPlugin.htm
I was able to update the customAttributes method to update the SAML response with additional attributes and this works well. However I have been searching everywhere to find the sample test class to go with the extension sample. Has anyone done this that can provide a basic sample?
I was able to update the customAttributes method to update the SAML response with additional attributes and this works well. However I have been searching everywhere to find the sample test class to go with the extension sample. Has anyone done this that can provide a basic sample?
All Answers
global override Map<String,String> customAttributes(Id userId, Id connectedAppId, Map<String,String>
formulaDefinedAttributes, Auth.InvocationContext context)
{
formulaDefinedAttributes.put('PermissionSets', 'test');
return formulaDefinedAttributes;
}
The line in you inital sample:
Map<String,String> respMapStr = cap.customAttributes(UserInfo.getUserId(),mapstr);
Needed to be this in format to work:
Map<String,String> respMapStr = cap.customAttributes(UserInfo.getUserId(),'connectedappid',mapstr,NULL);
Hopefully this helps others that are trying to figure this out as well.
Also I am not able to recieve Custom attributes configured with connected app.. without ConnectedAppPlugin class too.. I am using Node.js as Client .. Help ..