Re: Help with 400 Bad Request

Ulrich Klauer <[email protected]> Sun, 15 Feb 2015 12:10:55 +0100
Newsgroups gmane.comp.audio.musicbrainz.devel
Message-ID <[email protected]>
Joe Martinez wrote:

> Ok, I changed the user to "foo", and changed the qop value to just "auth".
> I still get the same error.  I tried on the real server with my real
> username and password, and got the same error as well.

There may be an error in the digest auth (re)implementation. Here's  
one of the headers:

Authorization: Digest username="foo", realm="musicbrainz.org",  
nonce="0SrG013lQXGx4D+kSt+MKA==",  
uri="/ws/2/rating?client=StarMyGrooves-1.0", algorithm=MD5,  
response="5bad0672d2471db82fcbe2458dadd97d", qop="auth",  
nc="00000001", cnonce="4498083", opaque="iya2HDCZRt2MaQ0ItxKNHg=="

When I calculate what the response should be, I get:
$ echo -n 'foo:musicbrainz.org:mb' | md5sum -
da514dfb6ce7e1c7a7f96c43058afce1  -
$ echo -n 'POST:/ws/2/rating?client=StarMyGrooves-1.0' | md5sum -
ff66f61b71a315cccce4812e96a65e84  -
$ echo -n  
'da514dfb6ce7e1c7a7f96c43058afce1:0SrG013lQXGx4D+kSt+MKA==:00000001:4498083:auth:ff66f61b71a315cccce4812e96a65e84' | md5sum  
-
9076ea78ed724151ad0f5ec046f4a348  -

However, the response is 5bad067..., not 9076ea7...

Ulrich