@salesforce/core 8.32.6-eca.2 → 8.32.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/org/authInfo.js
CHANGED
|
@@ -725,28 +725,17 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
|
|
|
725
725
|
}
|
|
726
726
|
else {
|
|
727
727
|
if (this.options.parentUsername) {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
options.clientId = process.env.SF_SCRATCH_SIGNUP_CONNECTED_APP;
|
|
733
|
-
if (process.env.SFDX_CLIENT_SECRET) {
|
|
734
|
-
options.clientSecret = process.env.SFDX_CLIENT_SECRET;
|
|
735
|
-
}
|
|
728
|
+
const parentFields = await this.loadDecryptedAuthFromConfig(this.options.parentUsername);
|
|
729
|
+
options.clientId = parentFields.clientId;
|
|
730
|
+
if (process.env.SFDX_CLIENT_SECRET) {
|
|
731
|
+
options.clientSecret = process.env.SFDX_CLIENT_SECRET;
|
|
736
732
|
}
|
|
737
733
|
else {
|
|
738
|
-
|
|
739
|
-
options
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}
|
|
743
|
-
else {
|
|
744
|
-
// Grab whatever flow is defined
|
|
745
|
-
Object.assign(options, {
|
|
746
|
-
clientSecret: parentFields.clientSecret,
|
|
747
|
-
privateKey: parentFields.privateKey ? (0, node_path_1.resolve)(parentFields.privateKey) : parentFields.privateKey,
|
|
748
|
-
});
|
|
749
|
-
}
|
|
734
|
+
// Grab whatever flow is defined
|
|
735
|
+
Object.assign(options, {
|
|
736
|
+
clientSecret: parentFields.clientSecret,
|
|
737
|
+
privateKey: parentFields.privateKey ? (0, node_path_1.resolve)(parentFields.privateKey) : parentFields.privateKey,
|
|
738
|
+
});
|
|
750
739
|
}
|
|
751
740
|
}
|
|
752
741
|
// jwt flow
|
|
@@ -60,13 +60,11 @@ const getOrgInstanceAuthority = function (scratchOrgInfoComplete, hubOrgLoginUrl
|
|
|
60
60
|
*/
|
|
61
61
|
const buildOAuth2Options = async (options) => {
|
|
62
62
|
const logger = await logger_1.Logger.child('buildOAuth2Options');
|
|
63
|
-
const
|
|
64
|
-
const isJwtFlow = !signupAppOverridden && !!options.hubOrg.getConnection().getAuthInfoFields().privateKey;
|
|
63
|
+
const isJwtFlow = !!options.hubOrg.getConnection().getAuthInfoFields().privateKey;
|
|
65
64
|
const oauth2Options = {
|
|
66
65
|
loginUrl: getOrgInstanceAuthority(options.scratchOrgInfoComplete, options.hubOrg.getField(org_1.Org.Fields.LOGIN_URL), options.signupTargetLoginUrl),
|
|
67
66
|
};
|
|
68
67
|
logger.debug(`isJwtFlow: ${isJwtFlow}`);
|
|
69
|
-
logger.debug(`signupAppOverridden: ${signupAppOverridden}`);
|
|
70
68
|
logger.debug(`using resolved loginUrl: ${oauth2Options.loginUrl ?? '<undefined>'}`);
|
|
71
69
|
if (isJwtFlow && !process.env.SFDX_CLIENT_SECRET) {
|
|
72
70
|
oauth2Options.privateKeyFile = options.hubOrg.getConnection().getAuthInfoFields().privateKey;
|
|
@@ -151,11 +151,11 @@ const generateScratchOrgInfo = async ({ hubOrg, scratchOrgInfoPayload, nonamespa
|
|
|
151
151
|
return {
|
|
152
152
|
...payload,
|
|
153
153
|
orgName: scratchOrgInfoPayload.orgName ?? 'Company',
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
// we already have the info, and want to get rid of configApi, so this doesn't use that
|
|
155
|
+
connectedAppCallbackUrl: `http://localhost:${await webOAuthServer_1.WebOAuthServer.determineOauthPort()}/OauthRedirect`,
|
|
156
156
|
...(!nonamespace && namespace ? { namespace } : {}),
|
|
157
|
+
// Use the Hub org's client ID value, if one wasn't provided to us, or the default
|
|
157
158
|
connectedAppConsumerKey: scratchOrgInfoPayload.connectedAppConsumerKey ??
|
|
158
|
-
process.env.SF_SCRATCH_SIGNUP_CONNECTED_APP ??
|
|
159
159
|
hubOrg.getConnection().getAuthInfoFields().clientId ??
|
|
160
160
|
authInfo_1.DEFAULT_CONNECTED_APP_INFO.clientId,
|
|
161
161
|
package2AncestorIds: !ignoreAncestorIds && sfProject?.hasPackages()
|