A command-line tool to automate GitHub Enterprise Cloud SSO setup with Microsoft Entra ID.
- π’ Automated Entra ID Setup: Creates and configures GitHub Enterprise Managed User application
- π§ SAML Configuration: Automates SAML settings, certificates, and URLs in Entra ID
- π₯ User Assignment: Automatically assigns current user with Enterprise Owner role
- π GitHub SAML Activation: Provides exact values and opens GitHub SAML settings page
- π OIDC Mode: Provides instructions to enable OIDC SSO (semi-manual)
- π SCIM Provisioning: Guides user to configure automatic user provisioning (currently manual)
- β Validation: Built-in checks for enterprise access and prerequisites
- π‘οΈ Safe Setup: Plan mode and confirmation prompts for critical actions
- π Web Interface: Simple web UI for generating setup plans without CLI
This tool automates the complex process described in Microsoft's GitHub Enterprise SSO documentation. Always verify your configuration in both GitHub and Entra ID admin portals after setup.
π¦ Download Latest Release β
- Go to Releases
- Download
ghec-sso.exe - Save it anywhere (e.g., Desktop, Downloads)
- Open Command Prompt or PowerShell where you saved the file
- Run:
.\ghec-sso.exe --help
# Install directly from GitHub repository
npm install -g git+https://github.com/benleane83/ghec-sso-setup.git- Node.js 16 or higher - Download here
- Git (for GitHub installation method) - Download here
# Clone the repository
git clone https://github.com/benleane83/ghec-sso-setup.git
cd ghec-sso-setup
# Install dependencies and build
npm install
npm run build
# Install globally
npm install -g .# Check if the tool is installed correctly
ghec-sso --help
# Check version
ghec-sso --version# To update to the latest version
npm uninstall -g ghec-sso-cli
npm install -g git+https://github.com/benleane83/ghec-sso-setup.git-
Authenticate with Azure:
ghec-sso auth login
-
Set up SSO for your enterprise:
ghec-sso setup --enterprise mycompany --domain mycompany.onmicrosoft.com
-
Follow the interactive prompts for SCIM setup after GitHub SSO is configured
For users who prefer a web interface over command line, this tool also provides a simple web UI for generating setup plans. There is a hosted version of this UI at https://ghec-sso-setup.azurewebsites.net/ which is free to use.
- Clean, responsive web interface
- Form validation for all required fields
- Support for both SAML and OIDC SSO types
- Support for both github.com and ghe.com environments
- Automatic HTML file generation and download
- Same setup plan generation logic as the CLI
Local Development:
# Start the web server
npm run start:web
# Development mode with auto-reload
npm run dev:webThe web interface will be available at http://localhost:3000
Azure Web App Deployment: See WEB-DEPLOYMENT.md for detailed deployment instructions to Azure Web App.
Automate Entra ID configuration and guide GitHub SSO setup.
ghec-sso setup [options]
Options:
-e, --enterprise <name> GitHub Enterprise name (e.g. for /enterprises/my-company, use my-company)
-d, --domain <domain> Organization domain (optional, e.g. company.onmicrosoft.com)
--plan Generate a HTML plan document with customized instructions for configuration
--plan-output <path> Custom output path for the setup plan (only with --plan)
--ssoType <type> SSO protocol type: saml (default) or oidc
--envType <type> GitHub environment type: github.com (default) or ghe.com
What it does:
- β Validates access
- π’ Creates GitHub Enterprise Managed User app in Entra ID
- βοΈ Configures SAML settings (URLs, certificates, claims)
- π€ Assigns current user as Enterprise Owner
- π Outputs SAML values for manual GitHub configuration
- π Opens GitHub Enterprise SAML settings page
Example:
# Interactive setup
ghec-sso setup
# With parameters
ghec-sso setup --enterprise mycompany
# Plan mode to generate a customized plan for the setup
ghec-sso setup --enterprise mycompany --plan
Manage authentication with Azure.
# Login to Azure
ghec-sso auth login
# Check authentication status and show enterprise access
ghec-sso auth status
# Clear stored authentication
ghec-sso auth logoutValidate enterprise access and SSO prerequisites. Only supports SAML SSO currently and not OIDC.
# Validate specific enterprise
ghec-sso validate --enterprise mycompanyAzure/Entra ID:
- Global Administrator or Application Administrator role
- Permission to create Enterprise Applications
- Permission to configure SSO and provisioning
- GitHub Enterprise name (e.g.,
mycompany) - Admin access to Entra ID
The CLI uses different authentication methods optimized for enterprise access:
- Azure: Device flow or Azure CLI credentials
- Attempts Azure CLI first for seamless experience
- Falls back to device flow authentication
- π Finds GitHub Enterprise Managed User template in application gallery
- π’ Creates Enterprise Application with proper naming
- βοΈ Configures SAML settings:
- Entity ID:
https://github.com/enterprises/{enterprise} - Reply URL:
https://github.com/enterprises/{enterprise}/saml/consume - Sign-on URL:
https://github.com/enterprises/{enterprise}/sso
- Entity ID:
- π Generates SAML signing certificate
- π€ Assigns current user with Enterprise Owner role
- π Extracts SAML configuration values
- π Opens GitHub Enterprise SAML settings page automatically
- π Provides exact values to copy into GitHub:
- Sign-On URL
- Issuer (Entity ID)
- Certificate (Base64)
OR
- π Opens GitHub OIDC SSO configuration page automatically
- π’ Prompts user to complete OIDC link
- π Configure SCIM provisioning:
- Auto-generates SCIM endpoint:
https://api.github.com/scim/v2/enterprises/{enterprise}/ - Prompts user to create a SCIM token, and enable provisioning on the Entra ID app
- Auto-generates SCIM endpoint:
- β GitHub Enterprise Cloud - Fully supported (Github.com or GHE.com)
- β Trial Enterprises - Fully supported
- β GitHub Enterprise Server - Not supported
- β Organizations - Not supported (use organization SAML instead)
- Ensure you have recovery access to GitHub Enterprise
- This configures SSO for the entire enterprise
- All users will need Entra ID accounts after setup
- Add additional users/groups to the Entra ID application
- Assign Copilot seats to users in GitHub if required
"Bad credentials" or 401 errors:
# Check current authentication
ghec-sso auth status
# Re-authenticate
ghec-sso auth logout
ghec-sso auth loginEntra ID application creation fails:
- Verify Azure permissions (Application Administrator role)
- Check tenant settings allow enterprise app creation
- Try manual creation if automated approach fails
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Submit a pull request
MIT License - see LICENSE file for details.
This tool handles sensitive authentication data:
- π Azure tokens are temporary and not persisted
- π SSO certificates are only displayed, not stored
