GitHub org connection not working when working with multiple GH orgs
vinodkone
HOBBYOP

a month ago

Description:

I'm using GitHub SSO to log into Railway. I need to connect repos from two sources:

  1. Personal repo: vinodkone/xxxx
  2. Org repo: / (I'm the org owner)

The Railway GitHub App is installed on both my personal account and the org with proper permissions granted.

Problem:

When I try to connect GitHub in Railway Account Settings, it only connects as "vinodkone" (personal account). It never asks me to authorize the org, and the branch selector shows "bad credentials" for the org repo.

Steps taken:

  • Disconnected and reconnected GitHub multiple times
  • Revoked Railway's OAuth access on GitHub
  • Uninstalled and reinstalled the Railway app on the org
  • Verified the app has access to the right repos on both accounts

Suspicion:

The GitHub SSO login flow for Railway may be interfering with the GitHub repo connection flow, preventing org-level authorization. I tried logging in with email instead of GitHub SSO, but the problem persists.

$10 Bounty

2 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway about 1 month ago


diegoelizondoc-dev
HOBBY

a month ago

Troubleshooting GitHub SSO and Org Repo Connection in Railway

It seems like the issue you're facing is related to how the Railway GitHub App is configured and authorized for both your personal account and the organization. Based on the details you provided and the search results, here’s a step-by-step guide to resolve the problem:


1. Ensure Proper Installation of the Railway GitHub App

The Railway GitHub App must be installed both on your personal account and on the organization. Even though you’ve already installed it, double-check the following:

  • Go to GitHub Settings > Applications > Installed GitHub Apps (direct link).
  • Locate the Railway GitHub App.
  • Click Configure and ensure:
    • The organization is listed under the app's installation.
    • The app has access to the specific repositories you want to use (both personal and organizational repos) .

2. Grant Access to the Organization

Even if the Railway app is installed on the organization, you need to explicitly grant access to it from your personal Railway account. Each Railway user has their own GitHub App installation that controls which repositories they can see. To ensure access:

  • Log in to your Railway account.
  • Go to Account Settings > GitHub Integration.
  • Disconnect and reconnect GitHub.
  • During the reconnection process, ensure that you authorize the app to access the organization. If prompted, select the organization and the repositories you want to connect .

3. Verify Repository Permissions

When configuring the Railway GitHub App, you must explicitly select the repositories you want to use. If the repositories are not selected, they won’t appear in Railway. To check:

  • Go to GitHub Settings > Applications > Installed GitHub Apps > Railway.
  • Under the organization, ensure the specific repositories are selected.
  • If you’re using "All repositories", confirm that the organization allows this level of access .

4. Address "Bad Credentials" Error

The "bad credentials" error typically occurs when the Railway app lacks proper authorization to access the organization’s repositories. To fix this:

  • Revoke the Railway app’s OAuth access:
    • Go to GitHub Settings > Applications > Authorized OAuth Apps.
    • Revoke access for Railway.
  • Reinstall the Railway app:
    • Uninstall the app from both your personal account and the organization.
    • Reinstall it via the Railway dashboard by reconnecting GitHub .

5. Check for SSO Interference

If your organization uses GitHub SSO, you may need to authorize the Railway app explicitly for SSO-protected repositories. To do this:

  • Go to GitHub Organization Settings > Security > SSO.
  • Ensure that the Railway app is authorized for SSO access.
  • If not, authorize it manually .

6. Test with a Fresh Connection

After completing the above steps, try reconnecting GitHub in Railway:

  1. Disconnect GitHub from your Railway account.
  2. Reconnect GitHub and ensure you select both your personal account and the organization during the authorization process.
  3. Check if the repositories (both personal and organizational) appear in the branch selector.

7. Additional Notes

  • If the issue persists, it’s possible that the organization’s permissions or policies are restricting access. In this case, contact your organization admin to verify that the Railway app is allowed to access the required repositories .
  • If you’re still unable to connect, consider reaching out to Railway support for further assistance.

By following these steps, you should be able to resolve the issue and connect both your personal and organizational repositories to Railway. Let me know if you need further clarification!


diegoelizondoc-dev

#### Troubleshooting GitHub SSO and Org Repo Connection in Railway It seems like the issue you're facing is related to how the Railway GitHub App is configured and authorized for both your personal account and the organization. Based on the details you provided and the search results, here’s a step-by-step guide to resolve the problem: --- ### **1. Ensure Proper Installation of the Railway GitHub App** The Railway GitHub App must be installed **both on your personal account** and **on the organization**. Even though you’ve already installed it, double-check the following: - Go to **GitHub Settings > Applications > Installed GitHub Apps** ([direct link](https://github.com/settings/installations)). - Locate the **Railway GitHub App**. - Click **Configure** and ensure: - The organization is listed under the app's installation. - The app has access to the specific repositories you want to use (both personal and organizational repos) . --- ### **2. Grant Access to the Organization** Even if the Railway app is installed on the organization, you need to explicitly grant access to it from your personal Railway account. Each Railway user has their own GitHub App installation that controls which repositories they can see. To ensure access: - Log in to your Railway account. - Go to **Account Settings > GitHub Integration**. - Disconnect and reconnect GitHub. - During the reconnection process, ensure that you authorize the app to access the organization. If prompted, select the organization and the repositories you want to connect . --- ### **3. Verify Repository Permissions** When configuring the Railway GitHub App, you must explicitly select the repositories you want to use. If the repositories are not selected, they won’t appear in Railway. To check: - Go to **GitHub Settings > Applications > Installed GitHub Apps > Railway**. - Under the organization, ensure the specific repositories are selected. - If you’re using **"All repositories"**, confirm that the organization allows this level of access . --- ### **4. Address "Bad Credentials" Error** The "bad credentials" error typically occurs when the Railway app lacks proper authorization to access the organization’s repositories. To fix this: - Revoke the Railway app’s OAuth access: - Go to **GitHub Settings > Applications > Authorized OAuth Apps**. - Revoke access for Railway. - Reinstall the Railway app: - Uninstall the app from both your personal account and the organization. - Reinstall it via the Railway dashboard by reconnecting GitHub . --- ### **5. Check for SSO Interference** If your organization uses **GitHub SSO**, you may need to authorize the Railway app explicitly for SSO-protected repositories. To do this: - Go to **GitHub Organization Settings > Security > SSO**. - Ensure that the Railway app is authorized for SSO access. - If not, authorize it manually . --- ### **6. Test with a Fresh Connection** After completing the above steps, try reconnecting GitHub in Railway: 1. Disconnect GitHub from your Railway account. 2. Reconnect GitHub and ensure you select both your personal account and the organization during the authorization process. 3. Check if the repositories (both personal and organizational) appear in the branch selector. --- ### **7. Additional Notes** - If the issue persists, it’s possible that the organization’s permissions or policies are restricting access. In this case, contact your organization admin to verify that the Railway app is allowed to access the required repositories . - If you’re still unable to connect, consider reaching out to Railway support for further assistance. --- By following these steps, you should be able to resolve the issue and connect both your personal and organizational repositories to Railway. Let me know if you need further clarification!

vinodkone
HOBBYOP

a month ago

  1. The link only shows the repo under your personal user account. You need to go to org's settings, to see the same for an org account.
  2. i verified it already
  3. When I disconnect and re-connect, it doesn't let me choose the organization. It just finishes by itself and only shows connected via my user account.
  4. I tried this. no luck
  5. no SSO
  6. Tried everything fresh, no luck
  7. Both my personal account and org account are mine, no 3rd party involved.

Welcome!

Sign in to your Railway account to join the conversation.

Loading...