Federated identity management using Active Directory Federation Services
To integrate on-premises AD FS (with MFA) and classic RD Web / Remote Desktop Gateway through Web Application Proxy, follow these high-level steps based on the documented pattern for publishing RD Gateway via AD FS pre-authentication.
- Prepare AD FS and Web Application Proxy (WAP)
- Ensure AD FS is deployed and configured, including MFA policies as required.
- Ensure Web Application Proxy is installed and joined to the AD FS farm.
- Confirm AD FS is reachable from WAP and that certificates and trust are correctly configured.
- Create a manual Relying Party Trust in AD FS for RD Gateway/RD Web
In AD FS Management on the AD FS server:- Open AD FS Management.
- Select Relying Party Trusts.
- Start the Add Relying Party Trust wizard.
- Choose Enter data about the relying party manually.
- Accept the default settings in the wizard (this is a “dummy” claims-aware RP used only to enforce pre-authentication).
- For the Relying Party Trust identifier, enter the external FQDN that will be used for RD Gateway/RD Web access, for example:
https://rdg.contoso.com/ - Finish the wizard.
- Publish RD Gateway / RD Web through Web Application Proxy with AD FS pre-auth
On the Web Application Proxy server:- Open the Remote Access Management console.
- Choose to Publish a new application.
- For the External URL, specify the same FQDN used in the relying party trust, e.g.
https://rdg.contoso.com/. Publish the root of the site (for example,https://rdg.contoso.com/). - Set Pre-authentication to AD FS.
- Select the relying party trust created in step 2 as the pre-authentication target.
- Configure backend URL to point to the internal RD Web/RD Gateway server (e.g.,
https://rdg.internal.contoso.com/).
https://rdg.contoso.com/) ensures that both/rdweband/rpcuse the same Web Application Proxy authentication cookie. Authentication to RD Web Access still uses the RD Web form logon, but the WAP/AD FS pre-authentication enforces MFA and SSO before the user reaches RD Web. - Configure RD Collection to support WAP pre-auth cookies (if required)
The documented pattern for RD Gateway via WAP uses custom RDP properties in RemoteApp RDP files so that:- The client knows pre-authentication is required.
- The browser-acquired WAP cookie is passed to the Remote Desktop Connection client (
mstsc.exe).
mstsc.execan reuse. - Align AD FS MFA and access policies
- In AD FS, configure Authentication Policies so that requests coming from WAP (extranet) to this relying party require MFA, as appropriate for your security requirements.
- AD FS supports differentiating policies for intranet vs extranet and per application. For high-value apps like RDS, consider requiring MFA for all external access.
- Ensure the chosen MFA provider (Microsoft Entra multifactor authentication or a third-party/custom provider) is enabled as a multifactor option in AD FS authentication policy.
- Test end-to-end
- From an external client, browse to
https://rdg.contoso.com/rdweb. - Confirm that WAP triggers AD FS pre-authentication and MFA.
- After successful AD FS sign-in, verify RD Web loads and that launching a RemoteApp uses the WAP cookie and does not prompt for additional credentials beyond the RD Web form (depending on your configuration).
- Validate that access is blocked when MFA requirements are not met, according to AD FS policy.
- From an external client, browse to
This pattern provides AD FS-based pre-authentication (including MFA) for classic RD Web/RD Gateway using Web Application Proxy and a manually created relying party trust.
References: