I have 2 Salesforce orgs (with identical code) - a hub and a client. I need to pass data from the hub to the client. Using S2S is fine for normal data, but when it comes to files (eg pdf) we can't use this.
I have a RestResource which accepts data from a third party (works fine) into the hub in JSON format, which includes the pdf. I need to push this to the client org and can use the same RestResource as it'll be the same JSON that is passed on, basically. I am trying to use a Named Credential to set up the link to the client org, but am unsure of what to do. We control both orgs.
In the hub org we have a dedicated user for API login(used by the 3rd party to pass through the JSON initially), but in the client org we don't have any spare logins, and I'm loathe to use the admin login for the Authentication. I've done a test and connected successfully using 'No Authentication' for the Authentication Protocol so I know the url works, but because it needs authentication to do the processing, I need to now add that in.
I'm confused by OAuth as that seems to be for things like LinkedIn, FB, etc as it needs the Authentication Provider. Using Username/Pwd seems to not be a good option as I only have the admin user I can use, which doesn't seem like the most secure option (or is it?). I don't know what AWS or JWT are for.
What do I put into the Authentication section? I can get the client/secret keys from the client org and create anything I might need in there, but am just not sure what the best option is.
I've created an Auth Provider and a Named Credential as below - both in the Hub org, but am getting an error when I try and save the NC. Where does the RestResource endpoint in the client get added in? Only where the callout is made? The key/secret are from the Connected App in the client org.