Claims-to-Windows Identity Translation Solutions and "Considerations" when using AD Application Proxy
Problem Statement:
At one of my consulting engagement this year my team were unable to communicate from a claims aware azure web application via client browser to an on-premise, windows authenticated SOAP endpoint. To overcome the identity endpoint mismatch, Claims and Windows, we were using the Azure Application Proxy to perform the identity translation. Our problems primarily occur in communicating between the browser and the Azure Application Proxy. We found multiple potential solutions to solve this problem, but each one has a fatal flaw. We do not need to solve for every solution, rather we only need 1 to work.
Solution 1:
Hide an iframe in the page that authenticates to the proxy by hitting a proxy endpoint and performing the redirect dance. Because the user must first log-in to the application, the iframe can reuse these credentials.
Process Flow Description:
- Iframe makes a request to the proxy endpoint (without authentication)
- Proxy returns a 302 redirect
- Iframe is redirected to AAD login page. Login cookies are submitted to AAD login because application requires authentication.
- Login successful returning token
- Sends token to proxy
- Proxy returns cookie that is valid for the proxy.
- Any future calls to the proxy can use the proxy cookie and make successful calls.
This solution works for the majority of cases except…
Fatal flaw: During step 3, if the user has multiple logins to Azure AD the user can not automatically be logged in because AAD returns an HTML to the hidden iframe asking which to use for login.
Potential fixes:
- Enable home realm discovery (Domain_Hint) for the Application Proxy
- When enabling domain hints, step 2 will return an updated redirect URL to include an extra parameter, ‘&domain_hint=fmi.com’. With this extra information in Step 3, the AAD login page can automatically determine which user to login as. Now the iframe can successfully login and the requests going forward will succeed.
- Blocker: this feature is not available yet for App Proxy.
- Use a Smart Link
- A smart link tells AAD login similar information as the domain hint. I’ve tried using the below smart link, but it does not automatically detect the user domain to use. e.g. https://myapps.microsoft.com/fmi.com/signin/Home%20Proxy%20Dev/000-000-000-000
- Blocker: The Smart link still requires me to choose which user to select.
Solution 2:
Use ADAL.js to retrieve a bearer token for authentication to the Application Proxy endpoint.
- ADAL.js calls AcquireToken to requesting a bearer token for the Application Proxy Endpoint.
- AAD returns an authentication token.
- We make JavaScript calls adding the header “authentication: bearer [token]” so we are properly authenticated to the endpoint.
This solution works for Internet Explorer but in any other browser it fails
Fatal Flaw: When making requests in step 3 with the authentication header, the browser sends a CORs preflight request. The proxy is not handling the OPTIONS request properly and is returning a 302.
Potential Fixes:
- Enable CORs on the Application Proxy so that Preflight requests are handled gracefully.
- Blocker: this feature is not available yet for App Proxy.
Summary:
We communicated these shortcomings of AAD Application Proxy to Microsoft and hope they would prioritize this feature in next release. Hope you would be able to customize your design keeping the above solutions and it's shortcomings in mind.
Topic Search
-
Securing TLS in WAC (Windows Admin Center) https://t.co/klDc7J7R4G
Posts by Date
- March 2025 1
- February 2025 1
- October 2024 1
- August 2024 1
- July 2024 1
- October 2023 1
- September 2023 1
- August 2023 3
- July 2023 1
- June 2023 2
- May 2023 1
- February 2023 3
- January 2023 1
- December 2022 1
- November 2022 3
- October 2022 7
- September 2022 2
- August 2022 4
- July 2022 1
- February 2022 2
- January 2022 1
- October 2021 1
- June 2021 2
- February 2021 1
- December 2020 2
- November 2020 2
- October 2020 1
- September 2020 1
- August 2020 1
- June 2020 1
- May 2020 2
- March 2020 1
- January 2020 2
- December 2019 2
- November 2019 1
- October 2019 7
- June 2019 2
- March 2019 2
- February 2019 1
- December 2018 3
- November 2018 1
- October 2018 4
- September 2018 6
- August 2018 1
- June 2018 1
- April 2018 2
- March 2018 1
- February 2018 3
- January 2018 2
- August 2017 5
- June 2017 2
- May 2017 3
- March 2017 4
- February 2017 4
- December 2016 1
- November 2016 3
- October 2016 3
- September 2016 5
- August 2016 11
- July 2016 13