How to use Fiddler Everywhere to inspect Android network traffic to troubleshoot SAML authentication issues
Recently Telerik would release Fiddler Everywhere, a free web debugging proxy, for macOS. Previously, Fiddler was native to Windows, and macOS users would have to resort to using Charles, or using Fiddler in Wine on their macOS. While Charles is great, it also wasn't free. With Fiddler Everywhere being a free offering, it has quickly cemented itself as a must-have tool for developers.
Thanks Telerik, my Hawaii vacation / retirement fund just grew by $50.
Today, we're going to cover how to use Fiddler Everywhere to capture network traffic from an Android device. This is useful if you need to review SAML responses when troubleshooting authentication. But before we proceed to the fun stuff....
Requirements:
- Telerik Fiddler Everywhere
https://www.telerik.com/fiddler-everywhere - Computer connected to network
- Android device connected to the same network as the computer
- Android device must have no Workspace ONE profiles installed that manage:
- Restrictions (limiting device network connectivity modifications)
- Google Chrome application configuration (forcing device traffic to a proxy specified in the application configuration)
Steps to capture traffic:
- Open 'System Preferences' on your macOS. If using a Windows operating system, navigate to 'Control Panel'
- Open 'Network' on your macO. If using a Windows operating system, navigate to 'Network and Sharing Center'
- Locate the RFC1918 IP Address of your computer, mine is 192.168.0.111. If using a Windows operating system; click on the connection, and in the new window that appears, click on 'Details'.
- Write this IP Address down, it will be used later
- Download and install Fiddler Everywhere, or Fiddler if using a Windows operating system.
- Open Fiddler Everywhere
- Ensure that Fiddler is capturing traffic
- Click the gear icon in the upper right corner to open 'Settings'
- In the 'HTTPS' tab, Ensure the 'Capture HTTPS traffic' checkbox is selected
- In the 'Connections' tab, specify a unused port to listen for traffic on. Ensure both 'Act as system proxy on startup' and 'Allow remote computers to connect' checkboxes are selected
- Click 'Save' and close 'Settings'
- Test that Fiddler Everywhere is running by navigating your localhost:port that you specified in 'Connections'. For my test, this will be;
http://192.168.0.111:8866/ - If Fiddler Everywhere is running, you will see the following web page. If it is not running, reset your Fiddler settings, ensure there are no firewalls prohibiting traffic, and reconfigure Fiddler Everywhere settings
- Grab your Android tablet.
- Open VMware Workspace ONE Hub
- Tap 'This Device', and then 'Profiles'. Remove 'Restrictions' profiles, in addition to profiles managing Google Chrome's Application Configuration
- Tap 'Settings', followed by 'Connections'
- Tap the Wi-Fi network you are connected to
- Tap the Wi-Fi Network you are connected to in the new window that appears
- Tap 'Advanced' in the next window that appears
- In the 'Proxy' drop-down, change it from 'None' to 'Manual'
- Enter the IP Address of your computer in the 'Proxy host name' form field
- Enter the port number Fiddler Everywhere is listening on in the 'Proxy port' form field;
- Tap 'Save'
- Open Google Chrome on the Android device
- Type in the HTTP Address that Fiddler Everywhere is listening on. In my example, this is http://192.168.0.111:8866
- If the URL is not accessible, verify your Android device is not connected to a VPN
- Tap the link to download the 'FiddlerRoot certificate'
- Click 'Continue'
- Enter your device PIN (or other form of authentication previously setup)
- In the new window that appears, name the certificate. In this example I will name it 'Fiddler-Test'
- Tap 'Ok'
- Prior to this, Fiddler would have been capturing HTTP traffic already
- Now that the Fiddler root certificate is installed on the device, HTTPS traffic is also being captured
- To verify HTTPS traffic is captured, we can test this by navigating to a web site. I will navigate to https://news.ycombinator.com/
- Open Fiddler Everywhere, and you will now be able to see all the HTTP Requests and HTTP Responses, including HTTPS traffic;
- Click on a entry and review the HTTP Headers, Text, Cookies, JSON, and XML
- Now you can proceed to test your service requiring authentication
- Review the HTTPS Request/Responses when authenticating
- Look for the SAMLRequest. To decode the SAML Request, OneLogin has a free tool to decrypt it. This tool is available at https://www.samltool.com/decrypt.php
OptimalIDM does a great job summarizing a SAML flow;
- The user requests an access to a relying party
- The user is redirected to the Identity Provider (IdP) with a SAML 2.0 authentication request
- The user then authenticates at the IdP
- A SAML 2.0 authentication response is then posted to the relying party
For more helpful tools to troubleshoot SAML, decode SAML messages, and more; OneLogin has compiled a set of tools that are a huge help.
For more information on Fiddler Everywhere, you can also check out these resources;
How to Debug iOS & Android Mobile Apps with #Fiddler - YouTube, Progress Telerik, Rob Lauer
How to Debug iOS & Android Mobile Apps with #Fiddler - YouTube, Progress Telerik, Rob Lauer
Progress Fiddle Everywhere Documentation - https://docs.telerik.com/fiddler-everywhere/introduction
Mahalo,
Ryan Pringnitz
Comments
Post a Comment