Skip to main content

Chapter 2: Identity & Single Sign-On

Part I: Foundation & Identity Prerequisites: Chapter 1: Enterprise Subscription & Environment Setup GH-100 Exam Mapping: Domain 2 (Manage user identities and GitHub authentication — 11%) Verified: 2026-02-01 against official documentation

1. Introduction​

Learning Objectives​

After completing this chapter, you will be able to:

  • Compare Enterprise Managed Users (EMU) with personal accounts using SAML Single Sign-On (SSO) and identify when each model is appropriate
  • Configure Security Assertion Markup Language (SAML) SSO between Microsoft Entra ID and a GitHub Enterprise Cloud organization
  • Set up OpenID Connect (OIDC) authentication for an EMU enterprise with Microsoft Entra ID
  • Implement conditional access policies and session management controls for GitHub Enterprise access
  • Describe how System for Cross-domain Identity Management (SCIM) provisioning works alongside SAML and OIDC authentication

Exam Domain Coverage​

DomainTopics in This Chapter
D2: Manage user identities and GitHub authentication (11%)EMU vs. personal account models, SAML SSO configuration, OIDC authentication, identity provider integration, session management, conditional access

Chapter Overview​

Identity and access management is the security foundation of any enterprise GitHub deployment. Before enabling Copilot policies, configuring repository access controls, or deploying coding agents, organizations must first establish how users authenticate to GitHub and how their identities are managed. For enterprises with 50 or more developers, getting identity right from the start prevents costly rework and security gaps later.

GitHub Enterprise Cloud offers two fundamentally different identity models: personal accounts with SAML SSO enforcement, and Enterprise Managed Users (EMU) where the identity provider (IdP) fully controls user lifecycle. Each model has distinct implications for developer experience, security posture, and administrative overhead. This chapter examines both models in depth and walks you through configuring Microsoft Entra ID (formerly Azure Active Directory) as your identity provider using both SAML and OIDC protocols.

By the end of this chapter, you will have a working SAML SSO integration between Microsoft Entra ID and your GitHub Enterprise Cloud trial, understand the tradeoffs between EMU and personal account models, and know how to apply conditional access policies that enforce your organization's security requirements.


2. Theory & Deep Dive​

Identity Models: EMU vs. Personal Accounts with SAML​

GitHub Enterprise Cloud supports two identity models. The choice between them is one of the most consequential architectural decisions an enterprise will make, and it should be decided before onboarding any developers.

Personal Accounts with SAML SSO​

In this model, developers create their own GitHub.com accounts (or use existing ones) and link them to the enterprise through SAML SSO. The enterprise enforces SAML authentication at the organization or enterprise level, meaning users must authenticate through the corporate IdP to access enterprise resources.

Key characteristics:

  • Developers own their GitHub accounts and retain them if they leave the organization
  • A single GitHub account can participate in multiple enterprises and open source projects
  • The enterprise enforces SAML authentication but does not control the account itself
  • Usernames are chosen by the developer and are not derived from the IdP
  • Personal contributions (open source, side projects) coexist on the same account
  • Two-factor authentication (2FA) can be required at the organization level but is managed by the user

When to use this model:

  • Organizations that want developers to contribute to open source under the same identity
  • Enterprises transitioning gradually from free GitHub usage to managed enterprise access
  • Companies that prefer a lighter-touch identity model with SAML enforcement only for enterprise resources

Enterprise Managed Users (EMU)​

In the EMU model, user accounts are created and fully managed by the enterprise's IdP through SCIM provisioning. Developers do not create their own accounts; instead, accounts are provisioned automatically when users are assigned to the GitHub EMU application in the IdP.

Key characteristics:

  • User accounts are owned and controlled by the enterprise, not the individual
  • Usernames follow a predictable pattern: IdP-username_enterprise-shortcode (e.g., jsmith_contoso)
  • When a user is deprovisioned in the IdP, their GitHub EMU account is suspended automatically
  • EMU accounts cannot contribute to public repositories or organizations outside the enterprise
  • All authentication is controlled exclusively through the IdP; no password-based GitHub login exists
  • SCIM provisioning is mandatory and handles user creation, updates, and deactivation
  • Enterprise owners can choose between SAML and OIDC for the authentication protocol

When to use this model:

  • Organizations with strict identity governance requirements (financial services, healthcare, government)
  • Enterprises that require full lifecycle management of developer accounts
  • Companies where developers should not have a personal GitHub presence linked to their work account
  • Organizations that need conditional access policy enforcement via OIDC (see section on OIDC below)
FeaturePersonal Accounts + SAMLEnterprise Managed Users
Account ownershipDeveloperEnterprise
Username formatUser-chosenidp-username_shortcode
Open source contributionsSame accountSeparate personal account required
SCIM provisioningOptional (for team sync)Mandatory
Account on offboardingUnlinked, still existsSuspended/deleted
Authentication protocolsSAMLSAML or OIDC
Conditional access (IdP)LimitedFull (with OIDC)
Outside collaboratorsSupportedSupported (limited)

Enterprise Scenario: A 300-developer healthcare company evaluates both models. Their compliance team requires that when a developer leaves, all GitHub access is immediately revoked with no residual account. They also need Microsoft Entra ID conditional access policies to restrict GitHub access to compliant, managed devices. They select EMU with OIDC authentication because it provides full account lifecycle control through SCIM, immediate suspension on deprovisioning, and native conditional access policy enforcement through OIDC token validation.

SAML SSO: How It Works with GitHub​

SAML 2.0 is a widely adopted standard for exchanging authentication and authorization data between an IdP (such as Microsoft Entra ID) and a service provider (SP), in this case GitHub. When SAML SSO is configured:

  1. A user navigates to GitHub and attempts to access an organization or enterprise resource
  2. GitHub redirects the user to the configured IdP (Microsoft Entra ID)
  3. The user authenticates with the IdP (password, multi-factor authentication, etc.)
  4. The IdP generates a signed SAML assertion containing user attributes (NameID, email, display name)
  5. The user's browser posts the SAML assertion back to GitHub's Assertion Consumer Service (ACS) URL
  6. GitHub validates the assertion signature, extracts identity claims, and grants access

SAML Configuration Parameters for GitHub:

The following parameters must be configured in both the IdP and GitHub:

ParameterValue Pattern
Identifier (Entity ID)https://github.com/enterprises/{enterprise} (enterprise-level) or https://github.com/orgs/{org} (org-level)
Reply URL (ACS)https://github.com/enterprises/{enterprise}/saml/consume or https://github.com/orgs/{org}/saml/consume
Sign-on URLhttps://github.com/enterprises/{enterprise}/sso or https://github.com/orgs/{org}/sso
NameID formaturn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
Signing CertificatePEM-encoded certificate downloaded from IdP

SAML Attribute Mapping:

GitHub expects specific attributes in the SAML assertion. For Microsoft Entra ID:

SAML AttributeEntra ID SourcePurpose
NameIDuser.mail (recommended) or user.userprincipalnamePrimary identifier for linking IdP identity to GitHub account
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameuser.userprincipalnameDisplay name resolution
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressuser.mailEmail verification

Enterprise Scenario: A 150-developer retail company configures SAML SSO for their three GitHub organizations. During initial testing, users report being unable to sign in. Investigation reveals the NameID attribute was mapped to user.userprincipalname (which uses the format user@contoso.onmicrosoft.com) instead of user.mail (which uses user@contoso.com). The mismatch between the SAML NameID and users' verified GitHub email addresses caused authentication failures. After correcting the attribute mapping to user.mail, all users authenticate successfully.

OIDC Authentication for EMU Enterprises​

OpenID Connect (OIDC) is an identity layer built on top of OAuth 2.0. For EMU enterprises, OIDC provides a significant advantage over SAML: native support for Conditional Access Policies (CAP) from the IdP. When an EMU enterprise uses OIDC with Microsoft Entra ID, GitHub validates the IdP's access token on every API request and web session, enabling real-time enforcement of conditional access policies.

Why OIDC matters for EMU:

  • Conditional Access Policy (CAP) enforcement: Microsoft Entra ID can enforce policies such as requiring compliant devices, specific network locations, or risk-based authentication. With OIDC, GitHub respects these policies in real time.
  • Token-based session validation: OIDC tokens have defined lifetimes and can be revoked. When a conditional access policy is violated (e.g., a user moves to an untrusted network), the token is invalidated and the user must re-authenticate.
  • Simplified session management: Unlike SAML where session management relies on periodic reauthentication, OIDC integrates directly with the IdP's session lifecycle.

OIDC vs. SAML for EMU — When to Choose Each:

ConsiderationSAMLOIDC
Conditional access policy supportNot natively supportedFully supported
IdP compatibilityAny SAML 2.0 IdPMicrosoft Entra ID only (for GitHub EMU)
Token/session revocationRelies on session timeoutReal-time via token validation
Setup complexityModerateModerate
Recommended forNon-Entra IdPs (Okta, PingFederate)Microsoft Entra ID environments

Important: As of the verification date, OIDC for GitHub EMU is supported only with Microsoft Entra ID. If your enterprise uses a different IdP (such as Okta or PingFederate), you must use SAML for EMU authentication.

Enterprise Scenario: A 500-developer financial services firm uses Microsoft Entra ID and has strict conditional access policies requiring managed, compliant devices for all SaaS access. With SAML, they discovered that developers who fell out of compliance (e.g., removed Intune management) could continue accessing GitHub until their session expired. By switching to OIDC, conditional access policies are evaluated on each token refresh, immediately blocking non-compliant devices from GitHub access.

Configuring SAML SSO with Microsoft Entra ID​

The configuration process involves parallel setup in both Microsoft Entra ID and GitHub. The following describes the enterprise-level SAML configuration, which enforces SSO across all organizations within the enterprise.

Microsoft Entra ID Side — Required Steps:

  1. Add the application: In the Microsoft Entra admin center (entra.microsoft.com), navigate to Entra ID > Enterprise applications > New application. Search for and add the appropriate gallery application:

    • For EMU: GitHub Enterprise Managed User
    • For personal accounts at the enterprise level: GitHub Enterprise Cloud - Enterprise Account
    • For personal accounts at the org level: GitHub (organization SSO)
  2. Configure Basic SAML settings: Edit the Basic SAML Configuration section:

    • Identifier (Entity ID): https://github.com/enterprises/{enterprise-slug} (no trailing slash)
    • Reply URL: https://github.com/enterprises/{enterprise-slug}/saml/consume
    • Sign-on URL: https://github.com/enterprises/{enterprise-slug}/sso
  3. Configure attribute mappings: Edit user attributes to map:

    • Unique User Identifier (Name ID) to user.mail
    • Ensure email, name, and display name claims are included
  4. Download the certificate: Download the Certificate (Base64) or Certificate (PEM) from the SAML Signing Certificate section. For EMU, PEM format is preferred.

  5. Copy configuration URLs: Note the Login URL, Microsoft Entra Identifier (Issuer), and Logout URL from the application setup page.

  6. Assign users and groups: Under Users and groups, assign the Entra ID security groups or individual users who should have access to GitHub. For EMU, role assignments (Enterprise Owner, Member) are configured here.

GitHub Side — Required Steps:

  1. Sign in to GitHub as an enterprise owner (or the setup user for EMU).
  2. Navigate to Settings > Authentication security (for organizations) or enterprise Settings > Authentication (for enterprise accounts).
  3. Enter the Sign-on URL (this is the Login URL from Entra ID).
  4. Enter the Issuer (this is the Microsoft Entra Identifier from Entra ID).
  5. Paste the contents of the downloaded public certificate into the Public certificate field.
  6. For non-EMU setups: Verify the Signature Method is RSA-SHA256 and Digest Method is SHA256.
  7. Click Test SAML configuration to validate the integration.
  8. Save the configuration.

Post-Configuration for Personal Account SAML:

After enabling SAML SSO, organization members must individually authorize their SAML identity. They are prompted the next time they access the organization. Enterprise owners can also require SAML SSO, which blocks access for any member who has not completed SAML authorization.

OIDC Configuration for EMU Enterprises​

OIDC configuration for EMU with Microsoft Entra ID uses a separate gallery application: GitHub Enterprise Managed User (OIDC).

Microsoft Entra ID Side:

  1. Add the GitHub Enterprise Managed User (OIDC) application from the gallery
  2. Configure single sign-on using OIDC (not SAML)
  3. The application automatically configures the required OIDC endpoints
  4. Assign users and groups with appropriate roles (Enterprise Owner, Member)

Provisioning (SCIM) Setup:

Both SAML and OIDC EMU setups require SCIM provisioning. In the Entra ID application:

  1. Navigate to the Provisioning tab and set mode to Automatic
  2. Enter the Tenant URL: https://api.github.com/scim/v2/enterprises/{enterprise} (for github.com) or https://api.{subdomain}.ghe.com/scim/v2/enterprises/{subdomain} (for GHE.com)
  3. Enter the Secret Token: A Personal Access Token (PAT) created by the enterprise setup user with the scim:enterprise scope
  4. Test the connection and save
  5. Configure attribute mappings for users and groups
  6. Enable provisioning and trigger an initial sync

SCIM Attribute Mappings (Users):

Microsoft Entra AttributeGitHub SCIM AttributeNotes
userPrincipalNameuserNamePrimary identifier
mailemails[type eq "work"].valueWork email
givenNamename.givenNameFirst name
surnamename.familyNameLast name
displayNamedisplayNameFull display name
objectIdexternalIdImmutable ID for matching
Switch([IsSoftDeleted], , "False", "True", "True", "False")activeAccount active state

Conditional Access Policies​

Conditional Access Policies (CAP) in Microsoft Entra ID allow administrators to enforce conditions under which users can access applications. For GitHub Enterprise, these policies are critically important for organizations with compliance requirements.

Common conditional access policies for GitHub:

  1. Require managed devices: Block access from unmanaged personal devices
  2. Require Multi-Factor Authentication (MFA): Enforce MFA for all GitHub access regardless of session state
  3. Location-based restrictions: Block access from geographic locations outside approved regions
  4. Risk-based authentication: Require step-up authentication when sign-in risk is detected
  5. Sign-in frequency: Force reauthentication after a defined period (e.g., every 8 hours)
  6. Persistent browser session control: Disable "stay signed in" functionality for unmanaged devices

Conditional Access with SAML vs. OIDC:

With SAML, conditional access policies are evaluated only at the point of authentication (when the user signs in). Once a valid SAML session is established, the user can continue accessing GitHub until the session expires, even if their compliance state changes.

With OIDC (EMU only), conditional access policies are evaluated continuously through token validation. When a user's access token is refreshed, Entra ID re-evaluates all applicable conditional access policies. If the user no longer meets the conditions (e.g., their device falls out of compliance), the token refresh is denied and GitHub access is blocked.

Creating a Conditional Access Policy for GitHub:

  1. Sign in to the Microsoft Entra admin center as a Conditional Access Administrator
  2. Navigate to Entra ID > Conditional Access > Policies > New policy
  3. Name the policy descriptively (e.g., GitHub - Require compliant device and MFA)
  4. Under Assignments > Users, include the groups assigned to your GitHub application
  5. Under Target resources > Cloud apps, select the GitHub Enterprise application
  6. Under Conditions, configure as needed:
    • Device platforms: Target specific OS platforms
    • Locations: Include or exclude named locations
    • Client apps: Select browser and mobile apps
  7. Under Access controls > Grant: Select Require multifactor authentication and/or Require device to be marked as compliant
  8. Under Access controls > Session: Configure Sign-in frequency (e.g., 8 hours) and Persistent browser session (e.g., Never persistent)
  9. Set Enable policy to Report-only first, then switch to On after validation

Enterprise Scenario: A 200-developer enterprise configures a conditional access policy requiring MFA and compliant devices for their GitHub EMU enterprise. During the report-only phase, they discover that 15% of their developers use Linux workstations that are not enrolled in Intune. Rather than blocking these developers, they create a separate policy that requires MFA and a trusted network location for Linux devices, while maintaining the compliant-device requirement for Windows and macOS. This layered approach enforces security without disrupting productivity.

Session Management Best Practices​

Session management controls how long a user stays authenticated and when they must re-authenticate. For GitHub Enterprise, session management spans both the IdP and GitHub itself.

Microsoft Entra ID Session Controls:

  • Sign-in frequency: Configurable per-application. For GitHub, a common enterprise setting is 8-12 hours for normal access and 1 hour for privileged administrative access.
  • Persistent browser session: Can be set to "Always persistent" (user stays signed in across browser restarts), "Never persistent" (user must authenticate on each browser session), or not configured (user sees the "Stay signed in?" prompt).
  • Continuous Access Evaluation (CAE): For OIDC-connected applications, CAE enables near-real-time enforcement of critical events such as user account disable, password change, or admin-initiated revoke.

GitHub Session Controls:

  • Session duration: GitHub sessions are valid for two weeks by default. Enterprise owners cannot directly configure this duration.
  • SAML session duration: When SAML SSO is enforced, the effective session duration is the shorter of the GitHub session or the IdP session configured through conditional access policies.
  • SSH key and PAT management: SAML SSO enforcement requires that SSH keys and Personal Access Tokens be authorized for SAML. Enterprise owners can set token lifetimes and require SAML authorization for API access.

3. Diagrams​

SAML SSO Authentication Flow​

sequenceDiagram
participant Dev as Developer Browser
participant GH as GitHub Enterprise
participant IdP as Microsoft Entra ID

Dev->>GH: 1. Access enterprise resource
GH-->>Dev: 2. Redirect to IdP (SAML AuthnRequest)
Dev->>IdP: 3. Follow redirect to Entra ID login
IdP->>IdP: 4. Authenticate user (password + MFA)
IdP->>IdP: 5. Evaluate conditional access policies
IdP-->>Dev: 6. Return signed SAML assertion
Dev->>GH: 7. POST assertion to ACS URL
GH->>GH: 8. Validate signature & extract claims
GH-->>Dev: 9. Grant access, establish session

Figure 1: SAML SSO authentication flow between a developer's browser, GitHub Enterprise (service provider), and Microsoft Entra ID (identity provider). Steps 4-5 occur at the IdP and include both credential verification and conditional access policy evaluation.

EMU Identity Model Comparison​

graph TB
subgraph "Personal Accounts + SAML SSO"
PA1[Developer creates<br/>personal GitHub account]
PA2[Enterprise enforces<br/>SAML SSO]
PA3[Developer links account<br/>via SAML authorization]
PA4[Account persists after<br/>developer leaves org]
PA1 --> PA2 --> PA3 --> PA4
end

subgraph "Enterprise Managed Users (EMU)"
EMU1[Admin assigns user in<br/>Microsoft Entra ID]
EMU2[SCIM provisions account<br/>in GitHub]
EMU3[User authenticates via<br/>SAML or OIDC]
EMU4[Account suspended when<br/>user removed from IdP]
EMU1 --> EMU2 --> EMU3 --> EMU4
end

style PA1 fill:#2d333b,stroke:#539bf5,color:#adbac7
style PA2 fill:#2d333b,stroke:#539bf5,color:#adbac7
style PA3 fill:#2d333b,stroke:#539bf5,color:#adbac7
style PA4 fill:#2d333b,stroke:#e5534b,color:#adbac7
style EMU1 fill:#2d333b,stroke:#57ab5a,color:#adbac7
style EMU2 fill:#2d333b,stroke:#57ab5a,color:#adbac7
style EMU3 fill:#2d333b,stroke:#57ab5a,color:#adbac7
style EMU4 fill:#2d333b,stroke:#57ab5a,color:#adbac7

Figure 2: Comparison of the two identity models. With personal accounts, the account outlives the employment relationship (red border). With EMU, the entire lifecycle is governed by the IdP (green borders), providing full control from provisioning to deprovisioning.

Conditional Access Policy Flow with OIDC​

flowchart LR
A[User requests<br/>GitHub access] --> B{OIDC token<br/>valid?}
B -- Yes --> C{Conditional access<br/>policies met?}
B -- No --> D[Redirect to<br/>Entra ID login]
C -- Yes --> E[Access granted]
C -- No --> F{Can user<br/>remediate?}
F -- Yes --> G[Prompt: enroll device,<br/>complete MFA, etc.]
F -- No --> H[Access denied]
G --> B
D --> B

style E fill:#2d333b,stroke:#57ab5a,color:#adbac7
style H fill:#2d333b,stroke:#e5534b,color:#adbac7

Figure 3: Conditional access policy evaluation flow for OIDC-connected EMU enterprises. Unlike SAML, OIDC enables policy evaluation on every token refresh, not just at initial sign-in.


4. Summary​

Key Takeaways:

  • Enterprise Managed Users (EMU) provides full account lifecycle management through the IdP, while personal accounts with SAML SSO offer flexibility and open source participation on the same identity
  • SAML SSO requires configuring matching settings in both Microsoft Entra ID and GitHub: Entity ID, Reply URL, Sign-on URL, and the signing certificate must align exactly
  • OIDC authentication for EMU (currently supported only with Microsoft Entra ID) enables real-time conditional access policy enforcement through token-based session validation
  • Conditional access policies are the primary mechanism for enforcing device compliance, MFA, and location-based restrictions for GitHub access
  • SCIM provisioning is mandatory for EMU and handles automated user creation, attribute synchronization, and deprovisioning when users are removed from the IdP

What's Next: See Chapter 3: SCIM Provisioning for configuring automated user and group provisioning, team synchronization, and handling edge cases in identity lifecycle management.


5. Hands-On Assignment​

Prerequisites Check: Before starting this lab, ensure you have completed:

  • A working GitHub Enterprise Cloud environment (Chapter 1: Enterprise Subscription & Environment Setup)
  • A Microsoft Entra ID tenant (free tier is sufficient)
  • GitHub CLI (gh) installed and authenticated

Lab: Configure SAML SSO for GitHub Enterprise Cloud​

Objective: Configure SAML Single Sign-On between Microsoft Entra ID and your GitHub Enterprise Cloud trial organization, test the authentication flow, and enforce SAML for all organization members.

Prerequisites:

  • A GitHub Enterprise Cloud trial (created in Chapter 1)
  • A Microsoft Entra ID tenant (a free tier tenant is sufficient)
  • Cloud Application Administrator (or higher) role in Microsoft Entra ID
  • Organization owner role in your GitHub organization
  • GitHub CLI (gh) installed (version 2.40 or later)

Assignment:

  1. Add the GitHub Enterprise Cloud application from the Microsoft Entra ID gallery and configure Basic SAML settings with your organization's Entity ID, Reply URL, and Sign-on URL
  2. Map the NameID attribute to user.mail and download the signing certificate
  3. Configure SAML SSO on the GitHub organization side using the Login URL, Issuer, and certificate from Entra ID
  4. Test the SAML configuration from both the Entra ID and GitHub sides
  5. Enforce SAML SSO for the organization and verify that unauthenticated access is blocked
  6. Create a basic conditional access policy in Entra ID requiring MFA for the GitHub application (report-only mode)

Expected Outcome: A working SAML SSO integration where organization members authenticate through Microsoft Entra ID. A conditional access policy in report-only mode that would require MFA for GitHub access.

Validation: When accessing https://github.com/orgs/YOUR-ORG/sso, you are redirected to Microsoft Entra ID for authentication. After authenticating, you are returned to GitHub with full organization access. The Entra ID sign-in logs show successful SAML authentication events for the GitHub application.


6. Step-by-Step Walkthrough​

This section provides a guided solution for the hands-on assignment above. If you completed the assignment independently, you can skip this section or use it to verify your approach.

Step 1: Add the GitHub Application in Microsoft Entra ID​

  1. Sign in to the Microsoft Entra admin center as a Cloud Application Administrator or higher
  2. Navigate to Entra ID > Enterprise applications > New application
  3. In the search box, type GitHub and select GitHub Enterprise Cloud - Organization from the results
  4. Click Create and wait for the application to be added to your tenant

Verify the application appears in your enterprise applications list:

# Using Azure CLI to verify (optional)
az ad app list --display-name "GitHub" --query "[].{Name:displayName, AppId:appId}" --output table

Step 2: Configure Basic SAML Settings​

  1. In the GitHub enterprise application, navigate to Single sign-on > SAML
  2. Click the pencil icon on Basic SAML Configuration
  3. Enter the following values (replace YOUR-ORG with your GitHub organization name):
FieldValue
Identifier (Entity ID)https://github.com/orgs/YOUR-ORG
Reply URL (ACS URL)https://github.com/orgs/YOUR-ORG/saml/consume
Sign on URLhttps://github.com/orgs/YOUR-ORG/sso
  1. Click Save

Step 3: Configure Attribute Mappings​

  1. In the User Attributes & Claims section, click Edit
  2. Click on the Unique User Identifier (Name ID) claim
  3. Change the Source attribute from user.userprincipalname to user.mail
  4. Ensure the Name identifier format is set to Email address
  5. Click Save

Verify the following claims are present (add them if missing):

Claim NameSource Attribute
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameuser.userprincipalname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressuser.mail

Step 4: Download the Signing Certificate​

  1. In the SAML Signing Certificate section, find Certificate (Base64)
  2. Click Download to save the certificate file to your computer
  3. Also copy the following values from the Set up GitHub section:
    • Login URL (e.g., https://login.microsoftonline.com/{tenant-id}/saml2)
    • Azure AD Identifier (e.g., https://sts.windows.net/{tenant-id}/)
    • Logout URL

Step 5: Assign Users to the Application​

  1. Navigate to Users and groups in the GitHub application
  2. Click Add user/group
  3. Under Users and groups, select the users or security group that should have GitHub access
  4. Click Assign

Step 6: Configure SAML SSO on GitHub​

  1. Open a new browser tab and sign in to GitHub as an organization owner
  2. Navigate to your organization: https://github.com/orgs/YOUR-ORG
  3. Click Settings > Authentication security
  4. Check Enable SAML authentication
  5. Enter the following values:
GitHub FieldValue from Entra ID
Sign on URLThe Login URL copied from Entra ID
IssuerThe Azure AD Identifier copied from Entra ID
Public certificateOpen the downloaded certificate in a text editor and paste the full contents
  1. Set the Signature Method to RSA-SHA256
  2. Set the Digest Method to SHA256

Step 7: Test the SAML Configuration​

  1. On the GitHub SAML configuration page, click Test SAML configuration
  2. A new window opens, redirecting you to Microsoft Entra ID
  3. Authenticate with your Entra ID credentials
  4. If successful, you see a confirmation message in GitHub

If the test fails, check:

  • The certificate was pasted completely (including -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines)
  • The Entity ID in Entra ID exactly matches https://github.com/orgs/YOUR-ORG (no trailing slash)
  • The NameID attribute maps to an email address that matches a verified email on the GitHub account

Step 8: Save and Enforce SAML SSO​

  1. After a successful test, click Save on the GitHub authentication security page
  2. To enforce SAML (require all members to authenticate via SAML), check Require SAML SSO authentication for all members of the YOUR-ORG organization
  3. Click Save

Verify SAML enforcement using the GitHub CLI:

# Check your SAML-linked identity
gh api /orgs/YOUR-ORG/members --jq '.[].login'

# Verify the organization's SSO enforcement
gh api /orgs/YOUR-ORG --jq '{sso: .two_factor_requirement_enabled}'

Step 9: Create a Conditional Access Policy (Report-Only)​

  1. Return to the Microsoft Entra admin center
  2. Navigate to Entra ID > Conditional Access > Policies > New policy
  3. Name the policy: GitHub - Require MFA (Report-Only)
  4. Under Assignments > Users: Select the same group assigned to the GitHub application
  5. Under Target resources > Cloud apps > Include: Select the GitHub enterprise application
  6. Under Access controls > Grant: Select Require multifactor authentication
  7. Set Enable policy to Report-only
  8. Click Create

Verification​

Confirm the full setup by performing a complete authentication cycle:

  1. Open a private/incognito browser window
  2. Navigate to https://github.com/orgs/YOUR-ORG/sso
  3. Verify you are redirected to Microsoft Entra ID
  4. Authenticate with your credentials (and MFA if prompted)
  5. Verify you are returned to GitHub with organization access

Check the Entra ID sign-in logs:

  1. In the Entra admin center, navigate to Entra ID > Sign-in logs
  2. Filter by Application = your GitHub application
  3. Verify a successful sign-in event with Authentication method = SAML
# Verify your SAML identity is linked
gh api /user --jq '{login: .login, email: .email}'

7. Q&A -- Chapter Review​

Instructions: Select the best answer for each question. Answers and explanations follow after all questions.

Question 1​

A 200-developer enterprise needs to ensure that when an employee is terminated, their GitHub access is revoked immediately and their account cannot be reused. Which identity model should they choose?

  • A) Personal accounts with SAML SSO enforced at the organization level
  • B) Personal accounts with SAML SSO enforced at the enterprise level
  • C) Enterprise Managed Users (EMU) with OIDC authentication
  • D) GitHub's built-in username/password authentication with 2FA

Question 2​

When configuring SAML SSO for a GitHub Enterprise Cloud organization in Microsoft Entra ID, which attribute should the Unique User Identifier (Name ID) be mapped to?

  • A) user.objectid
  • B) user.userprincipalname
  • C) user.mail
  • D) user.displayname

Question 3​

What is the primary advantage of OIDC over SAML for Enterprise Managed Users authentication?

  • A) OIDC supports more identity providers than SAML
  • B) OIDC enables real-time conditional access policy enforcement through token validation
  • C) OIDC does not require SCIM provisioning
  • D) OIDC eliminates the need for multi-factor authentication

Question 4​

An EMU enterprise uses SAML with Microsoft Entra ID. A developer's device falls out of compliance with the organization's Intune policy at 10:00 AM, but the developer's SAML session does not expire until 6:00 PM. What happens?

  • A) The developer is immediately blocked from GitHub
  • B) The developer continues to access GitHub until the SAML session expires at 6:00 PM
  • C) GitHub automatically checks device compliance every 15 minutes
  • D) The developer's EMU account is suspended by SCIM

Question 5​

Which of the following is a valid Reply URL (Assertion Consumer Service URL) for an enterprise-level SAML configuration on GitHub?

  • A) https://github.com/enterprises/contoso/saml/login
  • B) https://github.com/enterprises/contoso/saml/consume
  • C) https://github.com/enterprises/contoso/sso
  • D) https://github.com/saml/contoso/callback

Question 6​

In the Enterprise Managed Users model, what happens to a user's GitHub account when they are removed from the identity provider?

  • A) The account is converted to a personal GitHub account
  • B) The account remains active but loses organization membership
  • C) The account is suspended and can no longer access enterprise resources
  • D) The account is permanently deleted along with all contributions

Question 7​

A security team wants to restrict GitHub access to users connecting from approved corporate network locations only. Which mechanism should they use?

  • A) GitHub IP allow lists configured at the organization level
  • B) Microsoft Entra ID conditional access policy with named locations
  • C) GitHub repository branch protection rules
  • D) SSH key restrictions in the enterprise settings

Question 8​

What provisioning protocol is mandatory for Enterprise Managed Users (EMU) to manage user lifecycle?

  • A) SAML Just-in-Time (JIT) provisioning
  • B) LDAP synchronization
  • C) System for Cross-domain Identity Management (SCIM)
  • D) OAuth 2.0 device authorization

Question 9​

An organization has SAML SSO enabled but not enforced. Which statement is true?

  • A) All organization members must authenticate via SAML before accessing any resources
  • B) Members can access the organization without SAML authentication, but linking a SAML identity is optional
  • C) SAML SSO has no effect unless it is enforced
  • D) Only organization owners need to authenticate via SAML

Question 10​

Which Microsoft Entra ID role is the minimum required to configure a SAML SSO enterprise application for GitHub?

  • A) Global Administrator
  • B) Cloud Application Administrator
  • C) Security Administrator
  • D) User Administrator

Answer Key​

QAnswerExplanation
1CEnterprise Managed Users with OIDC provides full account lifecycle management. When a user is removed from the IdP, SCIM deprovisions their EMU account, and OIDC token validation ensures immediate access revocation. Personal accounts (options A and B) persist after the user leaves the organization.
2CGitHub expects the Name ID to be mapped to user.mail so it can match against the user's verified email address on GitHub. Using user.userprincipalname often causes mismatches because the UPN format may differ from the user's email.
3BOIDC's primary advantage for EMU is native conditional access policy enforcement. With OIDC, Microsoft Entra ID evaluates conditional access policies on each token refresh, enabling real-time blocking when compliance conditions are no longer met. SAML evaluates policies only at initial authentication.
4BWith SAML, conditional access policies are evaluated only at the point of authentication. Once a SAML session is established, the user retains access until the session expires, even if their device compliance state changes. This is a key reason enterprises with strict compliance requirements choose OIDC over SAML for EMU.
5BThe Reply URL (ACS URL) for enterprise-level SAML follows the pattern https://github.com/enterprises/{slug}/saml/consume. Option C is the Sign-on URL, not the Reply URL. Options A and D use incorrect URL patterns.
6CWhen a user is removed from the IdP, SCIM deprovisioning suspends the EMU account. The account is not deleted (preserving audit history and contribution records) but is fully blocked from accessing enterprise resources.
7BMicrosoft Entra ID conditional access policies with named locations allow administrators to restrict access to specific network ranges or geographic locations. This approach centralizes network-based access control at the IdP level, applying consistently across all Entra ID-integrated applications including GitHub.
8CSCIM provisioning is mandatory for EMU. It handles the complete user lifecycle: creating accounts when users are assigned in the IdP, synchronizing attribute changes, and suspending accounts when users are removed. SAML JIT provisioning is not used with EMU.
9BWhen SAML SSO is enabled but not enforced, members can access the organization without SAML authentication. Linking a SAML identity is optional. Once enforced, all members must authenticate via SAML to access organization resources.
10BCloud Application Administrator is the minimum Entra ID role required to add gallery applications and configure SAML SSO settings. Global Administrator also works but violates the principle of least privilege. Security Administrator and User Administrator do not have the necessary permissions for enterprise application configuration.