Note that there are some explanatory texts on larger screens.

plurals
  1. PODynDNS and the incontrovertible badauth response
    text
    copied!<p>I'm trying to use the DynDNS API to validate user-supplied DynDNS credentials, and <a href="http://dyn.com/support/developers/api/perform-update/" rel="nofollow">the documentation</a> says that <a href="http://dyn.com/support/developers/api/return-codes/" rel="nofollow">the 'badauth' response</a> is meant for exactly that.<br> The idea being that I can automate an update with the user credentials and look for the badauth response and use that to detect incorrect credentials, which sounds perfect.<br> The problem is that the only response I ever get is badauth. When I send credentials that should be good (since they're currently working for login and all) I get a badauth response. Here's my code:</p> <pre><code> try { string target = string.Format( "http://{0}:{1}@members.dyndns.org:8245/nic/update?hostname={2}&amp;myip={3}", HttpUtility.UrlEncode( DynDnsUserName ), HttpUtility.UrlEncode( DynDnsPassword ), HttpUtility.UrlEncode( DynDnsURL ), ip ); HttpWebRequest request = WebRequest.Create( target ) as HttpWebRequest; request.Method = "GET"; request.UserAgent = company + " - " + model + " - " + firmware; HttpWebResponse response = request.GetResponse() as HttpWebResponse; Stream reply = response.GetResponseStream(); StreamReader readReply = new StreamReader( reply ); string returnCode = readReply.ReadToEnd(); Trace.WriteLine( "We've validated the provided DynDNS credentials, response received: " + returnCode ); return !returnCode.Contains( "badauth" ); } catch (WebException webEx) { Trace.WriteLine( "WebException thrown: " + webEx.Message ); if (webEx.Response != null) { Stream reply = webEx.Response.GetResponseStream(); StreamReader readReply = new StreamReader( reply ); Trace.WriteLine( "Actual response: " + readReply.ReadToEnd() ); } } </code></pre> <p>No matter the credentials I use, I keep getting a thrown WebException "Remote server returned an error: (401) Unauthorized" with a response body of badauth. Any ideas? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload