Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Establish SAML 2.0 identity federation between on-premises Active Directory and Azure AD (Microsoft Entra ID) for seamless cross-domain authentication and SSO to cloud applications.
.claude/skills/building-identity-federation-with-saml-azure-ad/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-10 | ✗→✗ | = Same ✗ | — | — |
| case-17 | ✗→✗ | = Same ✗ | — | — |
| case-09 | ✗→✗ | = Same ✗ | — | — |
| case-18 | ✗→✗ | = Same ✗ | — | — |
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.
| 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 |
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| 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) |
powershell# 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
powershell# 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
powershell# Add Relying Party Trust for Azure AD Add-AdfsRelyingPartyTrust ` -Name "Microsoft Office 365 Identity Platform" ` -MetadataUrl "https://nexus.microsoftonline-p.com/federationmetadata/2007-06/federationmetadata.xml" # Configure claim rules $rules = @" @RuleTemplate = "LdapClaims" @RuleName = "Extract AD Attributes" c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"] => issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/claims/UPN", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname"), query = ";userPrincipalName,mail,givenName,sn;{0}", param = c.Value); @RuleTemplate = "PassThroughClaims" @RuleName = "Pass Through UPN as NameID" c:[Type == "http://schemas.xmlsoap.org/claims/UPN"] => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"); "@ Set-AdfsRelyingPartyTrust ` -TargetName "Microsoft Office 365 Identity Platform" ` -IssuanceTransformRules $rules
For each SaaS application that supports SAML SSO via Azure AD:
AD FS token-signing certificates expire and must be renewed:
powershell# Check current certificate expiration Get-AdfsCertificate -CertificateType Token-Signing | Select-Object Thumbprint, NotAfter # AD FS supports auto-rollover (enabled by default) Get-AdfsProperties | Select-Object AutoCertificateRollover # If manual rotation is needed: # 1. Add new certificate as secondary Set-AdfsCertificate -CertificateType Token-Signing -Thumbprint $newThumbprint -IsPrimary $false # 2. Update Azure AD with new certificate # 3. Promote to primary Set-AdfsCertificate -CertificateType Token-Signing -Thumbprint $newThumbprint -IsPrimary $true # 4. Remove old certificate Remove-AdfsCertificate -CertificateType Token-Signing -Thumbprint $oldThumbprint
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.