Hi,
We are developing a Salesforce application that integrates our external services.
We have build lightning components that call out and provision our services and interact with them through APIs.
Some time later the external services call back with results/outcomes, generally using a webhook mechanism.
We want to log those results to a table in Salesforce.
Initially we got something running in a scratch org by adding a Site that accepts the REST callback.
However this doesn't seem the correct way to package and distribute this webhook as we can't alllow machine authentication.
Instead we assume we should be using Connected Apps and now, because we are using 2GP, ECA, External Client Apps.
We are attempting to use this with the Client Credentials Flow.
In our DevHub we can enable this and see the button in setting to access the consumer key and secret.
Presumably we could use this to develop our package, but really we want to continue development in scratch orgs and package this properly with 2GP.
When we deploy to the scratch org we cannot see the above button.
We also tried to fetch the consumer key and secret using the API.
It is my first time using the API, but I think I managed to query it correctly
curl -XGET '
'
Even on the DevHub it returns an object, but never a secret to use with the client login flow
{"id":"************","name":"************** Connector","url":"/services/data/v63.0/apps/oauth/credentials/*************/************?part=secret"}
If I do the default request then the key is returned...
If I request part=keyandsecret then I just get the key
If I request part=secret then I don't get the key or secret.
Are we following the right strategy and best practise to be turning this into a package for distribution?
Can we continue development in our scratch orgs or does this mean we have to do all our development directly in our DevHub now? This is problematic because we only have the 2 full accounts there.
How come the API key which seems to be the way to go... doesn't ever return a secret?
#Salesforce Developer
How can I have my additional posting show up against the question?
Is it still waiting moderation?
It seemed super helpful for someone else?