Fiddler not capturing HTTP request/response from DevDefined library

1 Answer 388 Views
Windows
Stephan
Top achievements
Rank 1
Stephan asked on 14 Jul 2021, 11:33 PM

Hello, I have some old OAUTH/XAUTH code I am debugging and it uses the old DevDefined library.  The underlying HTTP requests/responses are simply not being picked up by Fiddler.  All other requests and responses on my machine are being picked up and displayed.

Here is an example of some C# code invoking the DevDefined method GetAccessTokenUsingXAuth(), and I know it is running and working, but I can't see the underlying request/response and wonder if some proxy is involved:

        /// <summary>
        /// Create Session
        /// </summary>
        /// <returns>Session, authorized for OAUTH using XAUTH protocol</returns>
        private static IOAuthSession CreateSession()
        {
            var consumerContext = new OAuthConsumerContext
            {
                ConsumerKey = ConsumerKey,
                ConsumerSecret = ConsumerSecret,
                SignatureMethod = SignatureMethod.HmacSha1,
            };

            var session = new OAuthSession(consumerContext, new Uri(BdBaseUrl + XAuthRelativeUrl));

            try
            {
                session.GetAccessTokenUsingXAuth(null, ServiceUser, ServicePassword);
            }
            catch (Exception e)
            {
                if (DumpOAuthInfoOnException)
                {
                    string serializedSession = JsonConvert.SerializeObject(session);
                    string msg =
                        $"Inner Exception on GetAccessTokenUsingXAuth.  Username {ServiceUser}, Password {ServicePassword}, Session: {serializedSession}";
                    throw new Exception(msg, e);
                }
                throw;
            }

            return session;
        }
Any help to be given here?  I have never tried to viewed one of these messages with Fiddler before, so I can't say it ever worked.  But the code has been working fine for years and years.
Stephan
Top achievements
Rank 1
commented on 15 Jul 2021, 07:26 AM

Thank you so much @Lini. THis works like a charm. So appreciate it.

1 Answer, 1 is accepted

Sort by
1
Accepted
Lini
Telerik team
answered on 15 Jul 2021, 06:58 AM

The OAuthSession class has a ProxyServerUri property. Try setting it to the Fiddler proxy address manually and see if this will route the request through:

            s.ProxyServerUri = new Uri("http://localhost:8888");

(use port 8888 if using Fiddler Classic and 8866 if using Fiddler Everywhere)

Tags
Windows
Asked by
Stephan
Top achievements
Rank 1
Answers by
Lini
Telerik team
Share this question
or