https://linen.dev logo
🚨 [ASK/Help] Composio GitHub Token (REDACTED)
# 🖥│support-forum
m
I've just started using Composio to access GitHub tokens. The project I'm building is similar to Vercel, but using Fly.io. The user flow is to connect through Composio, select a repository, and clone the repository to the sandbox. There's a problem when cloning the repository to the sandbox because the access token becomes REDACTED. How do I fix this? For example, I can include my code.
Copy code
typescript
// after connect with composio
let githubToken: string | undefined;
try {
  const entity = await composio.getEntity(buildData.userId);
  const connection = await entity.getConnection({ appName: "github" });
  githubToken = connection.connectionParams?.access_token; // this value always 'REDACTED'

} catch (e) {
  console.warn(
    `[Orchestrator] GitHub token not found for user ${buildData.userId}`,
  );
}
Copy code
typescript

// use the github token to clone the repository
async function cloneRepository(
  sandbox: Sandbox,
  repoUrl: string,
  branch: string = "main",
  githubToken?: string,
  workDir: string = "/home/user/project"
) {
  const normalizedUrl = normalizeRepoUrl(repoUrl);
  const authUrl = withGitHubToken(normalizedUrl, githubToken);

  const cloneCmd = `git clone --depth 1 --branch ${shellEscape(branch)} ${shellEscape(authUrl)} ${shellEscape(workDir)}`;

  console.log(`Cloning: ${redactGitCredentials(authUrl)}`);

  // the result always "Git clone authentication failed. Ensure the GitHub token is valid and has access to this repository"
  const result = await sandbox.commands.run(cloneCmd, {
    envs: { GIT_TERMINAL_PROMPT: "0" },
    timeoutMs: 5 * 60 * 1000,
  });

  if (result.exitCode !== 0) {
    const error = result.stderr || result.stdout;

    if (isGitAuthError(error)) {
      throw new Error("Git clone authentication failed, access token is missing");
    }
    if (isGitRepoNotFound(error)) {
      throw new Error("Repository not Found");
    }

    throw new Error(`Git clone failed: ${error}`);
  }

  return true;
}
u
Hi @muhammadzain.tsx , the
REDACTED
token is actually due to a recent change on our end. You can refer to this [changelog](https://docs.composio.dev/docs/changelog/2026/04/22) for more details.That said, the token masking is only applied to connected accounts using Composio's managed OAuth app, you should still be able to retrieve tokens from connected accounts using custom credentials. That said, I can temporarily add your project to our feature flag, which will give you enough time to migrate. Lmk.
2 Views