3

When you edit a connected app's policies, you get the option to choose which user the connected app runs as.

When you override the customAttributes method using a connected App Plugin class, you must specify a user or the code does not execute.

Does anyone know how to override the customAttributes method without specifying a particular user?

Thank you -Mitch

1 Answer 1

1

The selected user must be a system administrator. It runs in their security context. Please note that this isn't the user being authenticated, simply "who" is authenticating that user. This allows you to query data that may or may not be visible to the current user, as well as log any changes that occur as the administrator.

6
  • Must you select a user though? Dec 28, 2016 at 21:10
  • I am trying to get information about the current user, and the most recent account they viewed. Dec 28, 2016 at 21:11
  • @mitchspano Ah. The clarification helps. Unfortunately, no can do. You have to select a context user, you can't change the context programmatically (e.g. System.runAs), and you can't query the MRU tables of another user. Let's take a step back, though. Why do you need the MRU account of the user?
    – sfdcfox
    Dec 28, 2016 at 21:17
  • I want to have a button on the account page layout which grabs attributes from the current user and given account and passes those as custom SAML attributes to the SP Dec 28, 2016 at 21:19
  • but the connected app plugin class doesn't have access to current page values, so I was attempting to query to most recently viewed. Dec 28, 2016 at 21:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .