ADFS Authentication Setup
This guide walks you through integrating RAMP with Active Directory Federation Services (ADFS) for federated authentication and single sign-on.
What is ADFS Authentication?
Section titled “What is ADFS Authentication?”Active Directory Federation Services (ADFS) provides federated identity and access management across organizational boundaries. Benefits include:
- Single Sign-On (SSO) — Users authenticate once for multiple applications
- Federated authentication — Works across organizations and trusts
- Claims-based access — Fine-grained authorization based on user attributes
- Integration with Active Directory — Leverage existing user directory
Best For: Organizations with existing ADFS infrastructure, federated access scenarios (partners, subsidiaries), compliance requirements for centralized authentication, Windows Server environments.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- ADFS Server (version 2016 or later for OIDC support)
- Active Directory domain
- SSL Certificate installed on ADFS server
- Admin access to ADFS Management Console
- RAMP deployment (backend + frontend)
Architecture Overview
Section titled “Architecture Overview”+--------------+ +--------------+| Browser |---(1) Access RAMP------>| RAMP Web || (Client) | | (Frontend) |+--------------+ +--------------+ | | | (2) Redirect to ADFS | v |+--------------+ || ADFS |<---(3) Auth request------------+| Server |+--------------+ | | (4) User authenticates v+--------------+ +--------------+| Active |<---(5) Verify user------| ADFS || Directory | | Server |+--------------+ +--------------+ | (6) Return tokens | <-----------------------------+Quick Start
Section titled “Quick Start”-
Configure ADFS Application
Section titled “Configure ADFS Application”Add Application Group
Section titled “Add Application Group”- Open ADFS Management Console (
adfs.msc) - Navigate to Application Groups
- Right-click -> Add Application Group…
- Configuration:
- Name:
RAMP Application - Description:
RAMP Runbook Automation Platform - Template: Select Web browser accessing a web application
- Click Next
- Name:
Configure Web Application
Section titled “Configure Web Application”Native Application Settings:
- Name:
RAMP Web Client - Redirect URI:
https://ramp.yourdomain.com/_auth/callback - Client Identifier: (Auto-generated — save this for later, e.g.,
abc123-def456) - Click Next
Access Control Policy:
- Select Permit everyone (or create custom policy)
- Click Next
Summary:
- Review settings
- Click Next -> Close
Add Additional Redirect URIs
Section titled “Add Additional Redirect URIs”For development and additional endpoints:
- Right-click RAMP Application -> Properties
- Select the Web browser application
- Click Edit…
- Click Add to add additional redirect URIs:
https://ramp.yourdomain.com/_auth/callback(production)http://localhost:5173/_auth/callback(development)https://localhost:5173/_auth/callback(development with SSL)
- Click OK -> Apply
- Open ADFS Management Console (
-
Configure Claims Rules
Section titled “Configure Claims Rules”Claims rules map Active Directory attributes to tokens that RAMP receives.
Add LDAP Attributes as Claims
Section titled “Add LDAP Attributes as Claims”- In ADFS Management, expand Application Groups
- Right-click RAMP Application -> Properties
- Select the application -> Click Edit…
- Go to Issuance Transform Rules tab
- Click Add Rule…
- Rule Template:
Send LDAP Attributes as Claims - Click Next
- Claim rule name:
Send AD Attributes - Attribute store:
Active Directory - Configure mappings:
LDAP Attribute Outgoing Claim Type SAM-Account-NameName ID E-Mail-AddressesE-Mail Address Display-NameName Given-NameGiven Name SurnameSurname User-Principal-NameUPN - Click Finish -> OK -> Apply
Transform Name ID to Subject (sub) Claim
Section titled “Transform Name ID to Subject (sub) Claim”OIDC requires a
subclaim:- Click Add Rule… again
- Rule Template:
Transform an Incoming Claim - Click Next
- Claim rule name:
Transform Name ID to sub - Incoming claim type:
Name ID - Outgoing claim type:
Subject(or typesubif not in dropdown) - Outgoing name ID format: (leave blank)
- Pass through all claim values: Checked
- Click Finish -> OK -> Apply
-
Get ADFS Configuration Details
Section titled “Get ADFS Configuration Details”Verify OIDC Discovery Endpoint
Section titled “Verify OIDC Discovery Endpoint”Open browser and navigate to:
https://adfs.yourdomain.com/adfs/.well-known/openid-configurationExpected: JSON document with OIDC endpoints
Important Values to Note:
- Authority:
https://adfs.yourdomain.com/adfs - Authorization endpoint:
https://adfs.yourdomain.com/adfs/oauth2/authorize - Token endpoint:
https://adfs.yourdomain.com/adfs/oauth2/token - UserInfo endpoint:
https://adfs.yourdomain.com/adfs/userinfo
Note Your Client ID
Section titled “Note Your Client ID”The Client ID was auto-generated in the first step. To find it:
- ADFS Management -> Application Groups -> RAMP Application
- Double-click the application -> Properties
- Copy the Client Identifier (e.g.,
abc123-def456-ghi789)
- Authority:
-
Configure RAMP Frontend
Section titled “Configure RAMP Frontend”Create or update
.env.productioninsrc/RAMP.Web/:Terminal window # Enable OIDC AuthenticationVITE_OIDC_ENABLED=true# ADFS OIDC ConfigurationVITE_OIDC_AUTHORITY=https://adfs.yourdomain.com/adfsVITE_OIDC_CLIENT_ID=your-client-id-from-step-1VITE_OIDC_REDIRECT_URI=https://ramp.yourdomain.com/_auth/callbackVITE_OIDC_POST_LOGOUT_REDIRECT_URI=https://ramp.yourdomain.comVITE_OIDC_SCOPE=openid profile email allatclaimsVITE_OIDC_RESPONSE_TYPE=code# API endpointVITE_API_BASE_URL=https://ramp.yourdomain.com/apiTerminal window VITE_OIDC_ENABLED=trueVITE_OIDC_AUTHORITY=https://adfs.yourdomain.com/adfsVITE_OIDC_CLIENT_ID=your-dev-client-idVITE_OIDC_REDIRECT_URI=http://localhost:5173/_auth/callbackVITE_OIDC_POST_LOGOUT_REDIRECT_URI=http://localhost:5173VITE_OIDC_SCOPE=openid profile email allatclaimsConfiguration Notes:
allatclaimsscope requests all configured claims from ADFScoderesponse type uses Authorization Code flow (most secure)
-
Configure RAMP Backend (Optional)
Section titled “Configure RAMP Backend (Optional)”The backend validates tokens but doesn’t require ADFS-specific configuration. Update
appsettings.json:{"Jwt": {"Secret": "YourSecretKeyAtLeast32CharactersLong!","Issuer": "RAMP.API","Audience": "RAMP.Web","AccessTokenExpirationMinutes": 480,"RefreshTokenExpirationDays": 30}} -
Test the Integration
Section titled “Test the Integration”Start RAMP frontend:
Terminal window cd src/RAMP.Webnpm run devNavigate to RAMP:
- Development:
http://localhost:5173 - Production:
https://ramp.yourdomain.com
Expected flow:
- Redirected to ADFS login page
- Enter your domain credentials
- Redirected back to RAMP after successful auth
- Your name and email appear in RAMP UI
Verify Claims:
- Open browser Developer Tools (F12)
- Go to Network tab
- Find the callback request (e.g.,
/_auth/callback?code=...) - Inspect the JWT token (decode at jwt.io)
- Verify claims include:
sub,email,name
- Development:
Advanced Configuration
Section titled “Advanced Configuration”Group-Based Access Control
Section titled “Group-Based Access Control”Restrict RAMP access to specific Active Directory groups:
# PowerShell - Run on ADFS server$rule = @"@RuleName = "Permit RAMP Users Only"exists([Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value =~ "RAMP-Users"]) => issue(Type = "http://schemas.microsoft.com/authorization/claims/permit", Value = "true");"@
Set-AdfsRelyingPartyTrust -TargetName "RAMP Application" ` -IssuanceAuthorizationRules $ruleThis means only users in the “RAMP-Users” AD group can authenticate. Others will be denied at ADFS (before reaching RAMP).
Multi-Factor Authentication (MFA)
Section titled “Multi-Factor Authentication (MFA)”Require MFA for RAMP access:
# Require MFA for all RAMP usersSet-AdfsRelyingPartyTrust -TargetName "RAMP Application" ` -AdditionalAuthenticationRules 'c:[] => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod", Value = "http://schemas.microsoft.com/claims/multipleauthn");'This forces an MFA challenge (SMS, Microsoft Authenticator, etc.) on login. MFA policy is enforced by ADFS, not RAMP.
Custom Claims for Roles
Section titled “Custom Claims for Roles”Map AD groups to role claims:
# Example: Map AD group to role claim$ruleText = @"c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value =~ "(?i)^RAMP-Administrators$"] => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role", Value = "Administrator");
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", Value =~ "(?i)^RAMP-Coordinators$"] => issue(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role", Value = "Coordinator");"@
Set-AdfsRelyingPartyTrust -TargetName "RAMP Application" ` -IssuanceTransformRules $ruleTextToken Lifetime Configuration
Section titled “Token Lifetime Configuration”Configure how long tokens remain valid:
# Set access token lifetime to 1 hour (60 minutes)Set-AdfsRelyingPartyTrust -TargetName "RAMP Application" ` -TokenLifetime 60
# Disable "always require authentication" to allow refresh tokensSet-AdfsRelyingPartyTrust -TargetName "RAMP Application" ` -AlwaysRequireAuthentication $falseTroubleshooting
Section titled “Troubleshooting”Redirect URI Mismatch Error
Section titled “Redirect URI Mismatch Error”Error: AADSTS50011: The reply URL specified in the request does not match
Solution:
- Verify
VITE_OIDC_REDIRECT_URIexactly matches ADFS configuration - Check in ADFS: Application Groups -> RAMP -> Properties -> Edit -> Redirect URIs
- Ensure protocol matches (
httpvshttps) - Check trailing slashes (some systems are strict)
- Port numbers must match (include
:5173for dev, omit for standard HTTPS port 443)
Invalid Client ID Error
Section titled “Invalid Client ID Error”Error: invalid_client
Solution:
- Verify
VITE_OIDC_CLIENT_IDmatches exactly (case-sensitive) - Check in ADFS: Application Groups -> RAMP -> Properties -> Client Identifier
- Ensure you’re using the correct environment (dev vs prod client ID)
Missing Claims (No Email or Name)
Section titled “Missing Claims (No Email or Name)”Problem: User authenticates but email/name don’t appear in RAMP.
Solution:
-
Verify claims rules exist:
- ADFS Management -> Application Groups -> RAMP -> Properties -> Edit
- Issuance Transform Rules tab should show “Send AD Attributes” rule
-
Check user’s AD attributes:
Terminal window Get-ADUser -Identity username -Properties mail, displayName, givenName, snEnsure user has populated attributes
-
Test claims in token:
- Decode JWT token at jwt.io
- Check if claims are present:
email,name,given_name,family_name
-
Add missing claims rules (see Step 2)
CORS Errors
Section titled “CORS Errors”Problem: Browser console shows CORS policy errors.
Solution:
ADFS doesn’t support CORS for the token endpoint by design. Ensure you’re using:
- Authorization Code flow (not Implicit flow)
- OIDC library that handles token exchange server-side
- RAMP’s frontend is using
oidc-client-tslibrary correctly
Verify in .env:
VITE_OIDC_RESPONSE_TYPE=code # NOT "id_token" or "token"User Authenticated But No Roles in RAMP
Section titled “User Authenticated But No Roles in RAMP”Problem: User logs in successfully but has no permissions in RAMP.
Solution:
This is expected for first-time ADFS users. An administrator must assign roles:
- Log in as RAMP administrator
- Navigate to Admin -> Users
- Find the user (search by email)
- Click Assign Roles
- Assign appropriate roles (e.g., User, Coordinator, Administrator)
Alternatively, configure Bootstrap Administrators to auto-assign admin roles.
Security Best Practices
Section titled “Security Best Practices”Production Checklist
Section titled “Production Checklist”- Use HTTPS everywhere — RAMP and ADFS
- Valid SSL certificates — From trusted CA (not self-signed)
- Short token lifetimes — 60 minutes for access tokens
- Enable MFA — For all users or sensitive roles
- Group-based access control — Restrict to authorized AD groups
- Minimal claims — Only send necessary user attributes
- Audit logging — Enable in ADFS (Applications and Services Logs -> AD FS -> Admin)
- Regular updates — Apply ADFS and Windows Server patches
- Network security — Firewall rules, limit ADFS access
Claims Security
Section titled “Claims Security”Include in claims:
- User ID (
sub) - Email address
- Display name
- High-level roles (optional)
NEVER include in claims:
- Social Security Numbers
- Passwords or password hashes
- Sensitive personal information
- Detailed access permissions (use RAMP’s role system instead)
Token Storage
Section titled “Token Storage”RAMP stores tokens in browser session storage:
- Cleared when browser tab/window closes
- Not accessible to other websites
- Not persisted to disk
- Users must re-login after browser restart (by design)
User Provisioning
Section titled “User Provisioning”Automatic User Creation
Section titled “Automatic User Creation”When a user authenticates via ADFS for the first time:
- RAMP receives claims from ADFS (sub, email, name)
- RAMP checks if user with this
ProviderSubjectIdexists - If not, RAMP creates a new user account:
- Username: From
suborupnclaim - Email: From
emailclaim - Display Name: From
nameclaim - IdentityProvider:
ADFS - ProviderSubjectId: Unique identifier from ADFS
- Username: From
- User is logged in but has no roles by default
- Administrator must assign roles (or use Bootstrap Admins)
Required Claims
Section titled “Required Claims”ADFS must provide these claims for RAMP to work:
| Claim | Purpose | LDAP Source |
|---|---|---|
sub | Unique user identifier | SAM-Account-Name or UPN |
email | User’s email address | E-Mail-Addresses |
name | Display name | Display-Name |
If any are missing, user auto-provisioning will fail.
Migrating from WS-Federation to OIDC
Section titled “Migrating from WS-Federation to OIDC”If you’re currently using WS-Federation with an older ADFS version:
Why Migrate to OIDC?
Section titled “Why Migrate to OIDC?”- Modern standard — Industry-standard authentication protocol
- Better SPA support — Designed for single-page applications
- JSON-based — Easier than XML (SAML/WS-Fed)
- Wider ecosystem — More libraries and tools
- Mobile-friendly — Better support for native apps
Migration Steps
Section titled “Migration Steps”- Upgrade ADFS to 2016 or later (required for OIDC)
- Add OIDC application in ADFS (parallel to existing WS-Fed)
- Test OIDC in development environment
- Update RAMP frontend to use OIDC configuration
- Deploy and monitor
- Decommission WS-Fed application after successful migration
Next Steps
Section titled “Next Steps”After configuring ADFS authentication:
- Bootstrap Administrators Guide — Auto-assign admin roles
- MFA Setup — Add additional security layer
- Authentication Overview — Compare all authentication providers
- OIDC Setup — Generic OIDC configuration guide