跳到正文
Skillpedia
安全35k · #7698

building-identity-federation-with-saml-azure-ad

它能做什么

这个工具可以把公司的登录系统(也就是你输入密码的地方)与 Microsoft 365 等云服务连接起来。这样你就可以用同一个密码访问这些服务,既更安全,也更方便。

适用场景

  • ✓你希望用同一个密码访问公司系统和云服务时。
  • ✓你需要让公司的登录系统负责验证身份,哪怕是访问云服务时。
  • ✓你在设置新的云服务访问,并希望它能和现有登录系统无缝配合时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-identity-federation-with-saml-azure-ad/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/building-identity-federation-with-saml-azure-ad/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我设置单点登录(SSO),这样我就可以用公司密码访问 Microsoft 365。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会使用一种名为 SAML 的协议,在公司的登录系统和云服务之间建立安全的通信。这样,当你尝试访问云服务时,云服务会向公司系统确认你的身份。确认无误后,你无需再次输入密码即可进入。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Building Identity Federation with SAML Azure AD

Overview

Identity federation enables users authenticated by one identity provider to access resources managed by another without maintaining separate credentials. This skill covers establishing SAML 2.0 federation between an organization's on-premises Active Directory (via AD FS or third-party IdP) and Microsoft Entra ID (formerly Azure AD), as well as configuring federated SSO for third-party SaaS applications. Federation eliminates password synchronization concerns and keeps authentication authority on-premises while extending SSO to cloud resources.

When to Use

  • When deploying or configuring building identity federation with saml azure ad capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • On-premises Active Directory domain
  • AD FS 2019+ or third-party SAML IdP (Okta, Ping, etc.)
  • Microsoft Entra ID tenant (P1 or P2 license recommended)
  • Azure AD Connect (if using hybrid identity with password hash sync as backup)
  • Public TLS certificate for federation endpoint
  • DNS records for federation service name

Core Concepts

Federation Models

Model Authentication Authority Use Case
Federated (AD FS) On-premises AD FS Regulatory requirement to keep auth on-prem
Managed (PHS) Azure AD with password hash sync Simplest cloud auth, AD FS not needed
Managed (PTA) On-premises via pass-through agent Cloud auth validated against on-prem AD
Third-Party Federation External IdP (Okta, Ping) Multi-IdP environment

SAML Federation Architecture

User → Cloud App (SP)
   │
   └── Redirect to Azure AD
          │
          ├── Azure AD checks federated domain
          │
          └── Redirect to on-premises AD FS
                 │
                 ├── AD FS authenticates against Active Directory
                 │
                 ├── AD FS issues SAML token
                 │
                 └── Token posted back to Azure AD
                        │
                        ├── Azure AD validates federation trust
                        │
                        ├── Azure AD issues its own token
                        │
                        └── User receives access token for cloud app

Federation Trust Components

Component Description
Token-Signing Certificate X.509 certificate used by IdP to sign SAML assertions
Federation Metadata XML document describing IdP endpoints and capabilities
Relying Party Trust Configuration in AD FS for each SP (Azure AD)
Claims Rules Transform AD attributes into SAML claims
Issuer URI Unique identifier for the IdP (entity ID)

Workflow

Step 1: Prepare AD FS Infrastructure

# Install AD FS role
Install-WindowsFeature ADFS-Federation -IncludeManagementTools

# Configure AD FS farm
Install-AdfsFarm `
    -CertificateThumbprint $certThumbprint `
    -FederationServiceDisplayName "Corp Federation Service" `
    -FederationServiceName "fs.corp.example.com" `
    -ServiceAccountCredential $gmsaCredential

# Verify AD FS is operational
Get-AdfsProperties | Select-Object HostName, Identifier, FederationPassiveAddress

Step 2: Configure Azure AD Federated Domain

# Install Microsoft Graph PowerShell module
Install-Module Microsoft.Graph -Scope CurrentUser

# Connect to Microsoft Graph
Connect-MgGraph -Scopes "Domain.ReadWrite.All"

# Convert managed domain to federated
# Using AD FS federation metadata URL
$domainId = "corp.example.com"
$federationConfig = @{
    issuerUri = "http://fs.corp.example.com/adfs/services/trust"
    metadataExchangeUri = "https://fs.corp.example.com/adfs/services/trust/mex"
    passiveSignInUri = "https://fs.corp.example.com/adfs/ls/"
    signOutUri = "https://fs.corp.example.com/adfs/ls/?wa=wsignout1.0"
    signingCertificate = $base64Cert
    preferredAuthenticationProtocol = "saml"
}

# Apply federation settings to domain
New-MgDomainFederationConfiguration -DomainId $domainId -BodyParameter $federationConfig

Step 3: Configure AD FS Claims Rules

# Add Relying Party Trust for Azure AD
Add-AdfsRelyingPartyTrust `
    -Name "Microsoft Office 365 Identity Platform" `

…
常见问题

什么是“身份联合”?

可以把它想象成一张通用通行证。你不必为每个地方准备不同的通行证,只需用一张主通行证(公司登录),就能在多个地方(云服务)通行。

为什么要用 SAML?

SAML 是一种安全且广泛使用的标准,让不同系统之间可以交换用户身份信息,并确认该用户是否有权访问某些资源。

我需要把密码同步到云端吗?

不一定。使用身份联合时,密码验证仍由公司系统完成,无需把密码发送到云端。

详情

作者的原始描述

Configure SAML 2.0 identity federation between on-premises Active Directory (via AD FS or a third-party IdP) and Microsoft Entra ID, covering federation models (AD FS, password hash sync, pass-through auth, third-party IdP) and the SAML authentication flow. Use when extending on-premises authentication authority to cloud resources or designing hybrid identity SSO architecture for Entra ID.

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#7698
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能