Skip to content

Commit 24995ab

Browse files
jesseturner21claude
andcommitted
fix: write both CLIENT_ID and CLIENT_SECRET env vars for managed OAuth credentials
The createManagedOAuthCredential method was only writing the client secret with an incorrect env var name. Now correctly writes both _CLIENT_ID and _CLIENT_SECRET suffixed env vars, matching the pattern used by CredentialPrimitive. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 934520d commit 24995ab

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cli/primitives/GatewayPrimitive.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,10 @@ export class GatewayPrimitive extends BasePrimitive<AddGatewayOptions, Removable
397397
});
398398
await this.writeProjectSpec(project);
399399

400-
// Write client secret to .env
401-
const envVarName = computeDefaultCredentialEnvVarName(credentialName);
402-
await setEnvVar(envVarName, jwtConfig.agentClientSecret!);
400+
// Write client ID and client secret to .env
401+
const envVarPrefix = computeDefaultCredentialEnvVarName(credentialName);
402+
await setEnvVar(`${envVarPrefix}_CLIENT_ID`, jwtConfig.agentClientId!);
403+
await setEnvVar(`${envVarPrefix}_CLIENT_SECRET`, jwtConfig.agentClientSecret!);
403404
}
404405

405406
/**

0 commit comments

Comments
 (0)