Skip to main content

We have a named credential setup for ApexMDAPI  as Oauth2.0

Identity Type Named Principal

Authentication Protocol OAuth 2.0

Authentication Provider | ApexMDAPI

Scope | refresh_token full

Authentication Status | Authenticated as sysadmin profile user

 

List view export is working if the sharing setting is group or public. it's not working for private.

I understand why it's not working for private because it authenticates against the sys admin user.

 

Need advice what's the best way to authenticate ApexMDAPI. Tried not settings any auth got error.

 

any  advice is appreciated.

1 answer
  1. Jan 22, 2023, 2:56 PM

    @Aruna Rapole

     

    When the sharing setting for a record is set to "Private," the records are only accessible to the owner of the record and users with the "Modify All" or "View All" permissions for that object. 

    Therefore, when the ApexMDAPI is authenticated as the sysadmin user, it is not able to access records that have a sharing setting of "Private" because the sysadmin user does not necessarily have the "Modify All" or "View All" permissions for that object.

     

    One solution to this issue is to create a separate user with the "Modify All" or "View All" permissions for the object in question, and then use that user to authenticate ApexMDAPI instead of using the sysadmin user. This user can be a so-called "integration user" which only is used for integration purposes.

     

    Another option is to use Salesforce's "Permission Sets" feature to grant the necessary permissions to the sysadmin user without changing the profile.

    If neither of these solutions work, you can also try to use a connected app that uses the "System Administrator" profile and use that to authenticate ApexMDAPI.

0/9000